88namespace ZendTest \Expressive \ZendView ;
99
1010use ArrayObject ;
11- use PHPUnit_Framework_TestCase as TestCase ;
11+ use PHPUnit \ Framework \ TestCase ;
1212use Zend \Expressive \Template \Exception \InvalidArgumentException ;
1313use Zend \Expressive \Template \TemplatePath ;
1414use Zend \Expressive \ZendView \ZendViewRenderer ;
@@ -85,7 +85,8 @@ public function testInstantiatingWithoutEngineLazyLoadsOne()
8585
8686 public function testInstantiatingWithInvalidLayout ()
8787 {
88- $ this ->setExpectedException (InvalidArgumentException::class);
88+ $ this ->expectException (InvalidArgumentException::class);
89+
8990 new ZendViewRenderer (null , []);
9091 }
9192
@@ -95,7 +96,7 @@ public function testCanAddPathWithEmptyNamespace()
9596 $ renderer ->addPath (__DIR__ . '/TestAsset ' );
9697 $ paths = $ renderer ->getPaths ();
9798 $ this ->assertInternalType ('array ' , $ paths );
98- $ this ->assertEquals (1 , count ( $ paths) );
99+ $ this ->assertCount (1 , $ paths );
99100 $ this ->assertTemplatePath (__DIR__ . '/TestAsset ' . DIRECTORY_SEPARATOR , $ paths [0 ]);
100101 $ this ->assertTemplatePathString (__DIR__ . '/TestAsset ' . DIRECTORY_SEPARATOR , $ paths [0 ]);
101102 $ this ->assertEmptyTemplatePathNamespace ($ paths [0 ]);
@@ -107,7 +108,7 @@ public function testCanAddPathWithNamespace()
107108 $ renderer ->addPath (__DIR__ . '/TestAsset ' , 'test ' );
108109 $ paths = $ renderer ->getPaths ();
109110 $ this ->assertInternalType ('array ' , $ paths );
110- $ this ->assertEquals (1 , count ( $ paths) );
111+ $ this ->assertCount (1 , $ paths );
111112 $ this ->assertTemplatePath (__DIR__ . '/TestAsset ' . DIRECTORY_SEPARATOR , $ paths [0 ]);
112113 $ this ->assertTemplatePathString (__DIR__ . '/TestAsset ' . DIRECTORY_SEPARATOR , $ paths [0 ]);
113114 $ this ->assertTemplatePathNamespace ('test ' , $ paths [0 ]);
@@ -146,7 +147,8 @@ public function invalidParameterValues()
146147 public function testRenderRaisesExceptionForInvalidParameterTypes ($ params )
147148 {
148149 $ renderer = new ZendViewRenderer ();
149- $ this ->setExpectedException (InvalidArgumentException::class);
150+ $ this ->expectException (InvalidArgumentException::class);
151+
150152 $ renderer ->render ('foo ' , $ params );
151153 }
152154
@@ -202,7 +204,7 @@ public function testWillRenderContentInLayoutPassedToConstructor()
202204 $ content = file_get_contents (__DIR__ . '/TestAsset/zendview.phtml ' );
203205 $ content = str_replace ('<?php echo $name ?> ' , $ name , $ content );
204206 $ this ->assertContains ($ content , $ result );
205- $ this ->assertContains ('<title>Layout Page</title> ' , $ result , sprintf (" Received %s " , $ result ));
207+ $ this ->assertContains ('<title>Layout Page</title> ' , $ result , sprintf (' Received %s ' , $ result ));
206208 }
207209
208210 /**
@@ -255,7 +257,7 @@ public function testCanPassViewModelForLayoutToConstructor()
255257 $ content = file_get_contents (__DIR__ . '/TestAsset/zendview.phtml ' );
256258 $ content = str_replace ('<?php echo $name ?> ' , $ name , $ content );
257259 $ this ->assertContains ($ content , $ result );
258- $ this ->assertContains ('<title>Layout Page</title> ' , $ result , sprintf (" Received %s " , $ result ));
260+ $ this ->assertContains ('<title>Layout Page</title> ' , $ result , sprintf (' Received %s ' , $ result ));
259261 }
260262
261263 /**
0 commit comments