object = $this->getMockBuilder(StatementPaymentOverview::class)->getMockForAbstractClass(); $this->assertTrue(class_exists(StatementPaymentOverview::class)); $this->assertInstanceOf(StatementPaymentOverview::class, $this->object); } /** * Test property "delivery_method" * @dataProvider validDeliveryMethodDataProvider * @param mixed $value * * @return void * @throws Exception */ public function testDeliveryMethod(mixed $value): void { $instance = $this->getTestInstance(); $instance->setDeliveryMethod($value); self::assertNotNull($instance->getDeliveryMethod()); self::assertNotNull($instance->delivery_method); self::assertEquals($value, is_array($value) ? $instance->getDeliveryMethod()->toArray() : $instance->getDeliveryMethod()); self::assertEquals($value, is_array($value) ? $instance->delivery_method->toArray() : $instance->delivery_method); } /** * Test invalid property "delivery_method" * @dataProvider invalidDeliveryMethodDataProvider * @param mixed $value * @param string $exceptionClass * * @return void */ public function testInvalidDeliveryMethod(mixed $value, string $exceptionClass): void { $instance = $this->getTestInstance(); $this->expectException($exceptionClass); $instance->setDeliveryMethod($value); } /** * @return array[] * @throws Exception */ public function validDeliveryMethodDataProvider(): array { $instance = $this->getTestInstance(); return $this->getValidDataProviderByType($instance->getValidator()->getRulesByPropName('_delivery_method')); } /** * @return array[] * @throws Exception */ public function invalidDeliveryMethodDataProvider(): array { $instance = $this->getTestInstance(); return $this->getInvalidDataProviderByType($instance->getValidator()->getRulesByPropName('_delivery_method')); } }