*/ declare(strict_types=1); namespace oat\taoDeliveryRdf\test\unit\model\Delivery\DataAccess; use InvalidArgumentException; use oat\generis\test\TestCase; use oat\taoDeliveryRdf\model\Delivery\Business\Domain\DeliveryNamespace; use oat\taoDeliveryRdf\model\Delivery\DataAccess\DeliveryNamespaceRegistry; class DeliveryNamespaceRegistryTest extends TestCase { public function testDifferentDeliveryNamespace(): void { $deliveryNamespace = new DeliveryNamespace('https://taotesting.com'); $sut = new DeliveryNamespaceRegistry( new DeliveryNamespace('https://hub.taotesting.com'), $deliveryNamespace ); static::assertSame( $deliveryNamespace, $sut->get() ); } public function testNullDeliveryNamespace(): void { $sut = new DeliveryNamespaceRegistry( new DeliveryNamespace('https://hub.taotesting.com') ); static::assertNull( $sut->get() ); } public function testSameDeliveryNamespace(): void { $this->expectException(InvalidArgumentException::class); $deliveryNamespace = new DeliveryNamespace('https://taotesting.com'); new DeliveryNamespaceRegistry( clone $deliveryNamespace, $deliveryNamespace ); } }