object = $this->getMockBuilder(SbpPayerBankDetails::class)->getMockForAbstractClass(); $this->assertTrue(class_exists(SbpPayerBankDetails::class)); $this->assertInstanceOf(SbpPayerBankDetails::class, $this->object); } /** * Test property "bank_id" * @dataProvider validBankIdDataProvider * @param mixed $value * * @return void * @throws Exception */ public function testBankId(mixed $value): void { $instance = $this->getTestInstance(); $instance->setBankId($value); self::assertNotNull($instance->getBankId()); self::assertNotNull($instance->bank_id); self::assertEquals($value, $instance->getBankId()); self::assertEquals($value, $instance->bank_id); self::assertMatchesRegularExpression("/[a-zA-Z0-9]{12}/", $instance->getBankId()); self::assertMatchesRegularExpression("/[a-zA-Z0-9]{12}/", $instance->bank_id); self::assertEquals(12, is_string($instance->getBankId()) ? mb_strlen($instance->getBankId()) : $instance->getBankId()); self::assertEquals(12, is_string($instance->bank_id) ? mb_strlen($instance->bank_id) : $instance->bank_id); } /** * Test invalid property "bank_id" * @dataProvider invalidBankIdDataProvider * @param mixed $value * @param string $exceptionClass * * @return void */ public function testInvalidBankId(mixed $value, string $exceptionClass): void { $instance = $this->getTestInstance(); $this->expectException($exceptionClass); $instance->setBankId($value); } /** * @return array[] * @throws Exception */ public function validBankIdDataProvider(): array { $instance = $this->getTestInstance(); return $this->getValidDataProviderByType($instance->getValidator()->getRulesByPropName('_bank_id')); } /** * @return array[] * @throws Exception */ public function invalidBankIdDataProvider(): array { $instance = $this->getTestInstance(); return $this->getInvalidDataProviderByType($instance->getValidator()->getRulesByPropName('_bank_id')); } /** * Test property "bic" * @dataProvider validBicDataProvider * @param mixed $value * * @return void * @throws Exception */ public function testBic(mixed $value): void { $instance = $this->getTestInstance(); $instance->setBic($value); self::assertNotNull($instance->getBic()); self::assertNotNull($instance->bic); self::assertEquals($value, $instance->getBic()); self::assertEquals($value, $instance->bic); } /** * Test invalid property "bic" * @dataProvider invalidBicDataProvider * @param mixed $value * @param string $exceptionClass * * @return void */ public function testInvalidBic(mixed $value, string $exceptionClass): void { $instance = $this->getTestInstance(); $this->expectException($exceptionClass); $instance->setBic($value); } /** * @return array[] * @throws Exception */ public function validBicDataProvider(): array { $instance = $this->getTestInstance(); return $this->getValidDataProviderByType($instance->getValidator()->getRulesByPropName('_bic')); } /** * @return array[] * @throws Exception */ public function invalidBicDataProvider(): array { $instance = $this->getTestInstance(); return $this->getInvalidDataProviderByType($instance->getValidator()->getRulesByPropName('_bic')); } }