object = $this->getMockBuilder(PaymentOrderRecipientBankUtilities::class)->getMockForAbstractClass(); $this->assertTrue(class_exists(PaymentOrderRecipientBankUtilities::class)); $this->assertInstanceOf(PaymentOrderRecipientBankUtilities::class, $this->object); } /** * Test property "name" * @dataProvider validNameDataProvider * @param mixed $value * * @return void * @throws Exception */ public function testName(mixed $value): void { $instance = $this->getTestInstance(); $instance->setName($value); self::assertNotNull($instance->getName()); self::assertNotNull($instance->name); self::assertEquals($value, $instance->getName()); self::assertEquals($value, $instance->name); } /** * Test invalid property "name" * @dataProvider invalidNameDataProvider * @param mixed $value * @param string $exceptionClass * * @return void */ public function testInvalidName(mixed $value, string $exceptionClass): void { $instance = $this->getTestInstance(); $this->expectException($exceptionClass); $instance->setName($value); } /** * @return array[] * @throws Exception */ public function validNameDataProvider(): array { $instance = $this->getTestInstance(); return $this->getValidDataProviderByType($instance->getValidator()->getRulesByPropName('_name')); } /** * @return array[] * @throws Exception */ public function invalidNameDataProvider(): array { $instance = $this->getTestInstance(); return $this->getInvalidDataProviderByType($instance->getValidator()->getRulesByPropName('_name')); } /** * 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); self::assertMatchesRegularExpression("/[0-9]{9}/", $instance->getBic()); self::assertMatchesRegularExpression("/[0-9]{9}/", $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')); } /** * Test property "account" * @dataProvider validAccountDataProvider * @param mixed $value * * @return void * @throws Exception */ public function testAccount(mixed $value): void { $instance = $this->getTestInstance(); $instance->setAccount($value); self::assertNotNull($instance->getAccount()); self::assertNotNull($instance->account); self::assertEquals($value, $instance->getAccount()); self::assertEquals($value, $instance->account); } /** * Test invalid property "account" * @dataProvider invalidAccountDataProvider * @param mixed $value * @param string $exceptionClass * * @return void */ public function testInvalidAccount(mixed $value, string $exceptionClass): void { $instance = $this->getTestInstance(); $this->expectException($exceptionClass); $instance->setAccount($value); } /** * @return array[] * @throws Exception */ public function validAccountDataProvider(): array { $instance = $this->getTestInstance(); return $this->getValidDataProviderByType($instance->getValidator()->getRulesByPropName('_account')); } /** * @return array[] * @throws Exception */ public function invalidAccountDataProvider(): array { $instance = $this->getTestInstance(); return $this->getInvalidDataProviderByType($instance->getValidator()->getRulesByPropName('_account')); } /** * Test property "correspondent_account" * @dataProvider validCorrespondentAccountDataProvider * @param mixed $value * * @return void * @throws Exception */ public function testCorrespondentAccount(mixed $value): void { $instance = $this->getTestInstance(); $instance->setCorrespondentAccount($value); self::assertNotNull($instance->getCorrespondentAccount()); self::assertNotNull($instance->correspondent_account); self::assertNotNull($instance->correspondentAccount); self::assertEquals($value, $instance->getCorrespondentAccount()); self::assertEquals($value, $instance->correspondent_account); self::assertEquals($value, $instance->correspondentAccount); } /** * Test invalid property "correspondent_account" * @dataProvider invalidCorrespondentAccountDataProvider * @param mixed $value * @param string $exceptionClass * * @return void */ public function testInvalidCorrespondentAccount(mixed $value, string $exceptionClass): void { $instance = $this->getTestInstance(); $this->expectException($exceptionClass); $instance->setCorrespondentAccount($value); } /** * @return array[] * @throws Exception */ public function validCorrespondentAccountDataProvider(): array { $instance = $this->getTestInstance(); return $this->getValidDataProviderByType($instance->getValidator()->getRulesByPropName('_correspondent_account')); } /** * @return array[] * @throws Exception */ public function invalidCorrespondentAccountDataProvider(): array { $instance = $this->getTestInstance(); return $this->getInvalidDataProviderByType($instance->getValidator()->getRulesByPropName('_correspondent_account')); } }