33namespace Hyunk3l \Test \PhpDesignPatterns \Creational \Builder ;
44
55use Hyunk3l \PhpDesignPatterns \Creational \Builder \ClassicWatchBuilder ;
6+ use Hyunk3l \PhpDesignPatterns \Creational \Builder \Components \Box ;
7+ use Hyunk3l \PhpDesignPatterns \Creational \Builder \Watch ;
8+ use Hyunk3l \PhpDesignPatterns \Creational \Builder \WatchBuilderInterface ;
69use PHPUnit \Framework \TestCase ;
710
811/**
@@ -37,8 +40,9 @@ public function tearDown()
3740 /**
3841 * Testing interface contract.
3942 */
40- public function testInterfaceContract () {
41- $ this ->assertInstanceOf ('PhpDesignPatterns\Creational\Builder\WatchBuilderInterface ' , $ this ->builder );
43+ public function testInterfaceContract ()
44+ {
45+ $ this ->assertInstanceOf (WatchBuilderInterface::class, $ this ->builder );
4246 }
4347
4448 /**
@@ -47,7 +51,7 @@ public function testInterfaceContract() {
4751 public function testWatchCreation ()
4852 {
4953 $ this ->builder ->createWatch ();
50- $ this ->assertInstanceOf (' PhpDesignPatterns\Creational\Builder\ Watch' , $ this ->builder ->getWatch ());
54+ $ this ->assertInstanceOf (Watch::class , $ this ->builder ->getWatch ());
5155 }
5256
5357 /**
@@ -58,8 +62,7 @@ public function testAddBox()
5862 $ this ->builder ->createWatch ();
5963 $ this ->builder ->addBox ();
6064
61- $ expected = array ("watch box " => $ this ->getMock ("PhpDesignPatterns \\Creational \\Builder \\Components \\Box " ));
62- $ this ->assertInstanceOf ('PhpDesignPatterns\Creational\Builder\Watch ' , $ this ->builder ->getWatch ());
65+ $ this ->assertInstanceOf (Watch::class, $ this ->builder ->getWatch ());
6366 }
6467
6568 /**
@@ -70,7 +73,6 @@ public function testAddHands()
7073 $ this ->builder ->createWatch ();
7174 $ this ->builder ->addHands ();
7275
73- $ expected = array ("Minutes Hand " => $ this ->getMock ("PhpDesignPatterns \\Creational \\Builder \\Components \\Hand " ));
74- $ this ->assertInstanceOf ('PhpDesignPatterns\Creational\Builder\Watch ' , $ this ->builder ->getWatch ());
76+ $ this ->assertInstanceOf (Watch::class, $ this ->builder ->getWatch ());
7577 }
7678}
0 commit comments