<?phpnamespaceDesignPatterns\Creational\Prototype\Tests;useDesignPatterns\Creational\Prototype\BarBookPrototype;useDesignPatterns\Creational\Prototype\FooBookPrototype;usePHPUnit\Framework\TestCase;classPrototypeTestextendsTestCase{publicfunctiontestCanGetFooBook(){$fooPrototype=newFooBookPrototype();$barPrototype=newBarBookPrototype();for($i=0;$i<10;$i++){$book=clone$fooPrototype;$book->setTitle('Foo Book No '.$i);$this->assertInstanceOf(FooBookPrototype::class,$book);}for($i=0;$i<5;$i++){$book=clone$barPrototype;$book->setTitle('Bar Book No '.$i);$this->assertInstanceOf(BarBookPrototype::class,$book);}}}