object = $this->getMockBuilder(ConfirmationExternal::class)->getMockForAbstractClass(); $this->assertTrue(class_exists(ConfirmationExternal::class)); $this->assertInstanceOf(ConfirmationExternal::class, $this->object); } /** * Test property "type" * * @return void * @throws Exception */ public function testType(): void { $instance = $this->getTestInstance(); self::assertContains($instance->getType(), ['external']); self::assertContains($instance->type, ['external']); self::assertNotNull($instance->getType()); self::assertNotNull($instance->type); } /** * Test invalid property "type" * @dataProvider invalidTypeDataProvider * @param mixed $value * @param string $exceptionClass * * @return void */ public function testInvalidType(mixed $value, string $exceptionClass): void { $instance = $this->getTestInstance(); $this->expectException($exceptionClass); $instance->setType($value); } /** * @return array[] * @throws Exception */ public function invalidTypeDataProvider(): array { $instance = $this->getTestInstance(); return $this->getInvalidDataProviderByType($instance->getValidator()->getRulesByPropName('_type')); } }