1414use Doctrine \Common \Persistence \ManagerRegistry ;
1515use Doctrine \ODM \PHPCR \DocumentManager ;
1616use Doctrine \ODM \PHPCR \UnitOfWork ;
17+ use PHPUnit \Framework \TestCase ;
1718use Symfony \Cmf \Bundle \CoreBundle \PublishWorkflow \PublishWorkflowChecker ;
1819use Symfony \Cmf \Bundle \CoreBundle \Templating \Helper \Cmf ;
1920use Symfony \Cmf \Component \Routing \RouteReferrersReadInterface ;
21+ use Symfony \Component \Config \Definition \Exception \InvalidConfigurationException ;
2022use Symfony \Component \Routing \Route ;
2123use Symfony \Component \Security \Core \Authorization \AuthorizationCheckerInterface ;
2224
23- class CmfTest extends \PHPUnit_Framework_TestCase
25+ class CmfTest extends TestCase
2426{
2527 private $ pwc ;
2628
@@ -220,9 +222,6 @@ public function testFindManyLimitOffset()
220222 $ this ->assertEquals ([$ documentB ], $ this ->helper ->findMany (['/foo ' , 'bar ' ], 1 , 1 , null ));
221223 }
222224
223- /**
224- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
225- */
226225 public function testFindManyNoWorkflow ()
227226 {
228227 $ extension = new Cmf (null );
@@ -236,6 +235,7 @@ public function testFindManyNoWorkflow()
236235 ->will ($ this ->returnValue ($ documentA ))
237236 ;
238237
238+ $ this ->expectException (InvalidConfigurationException::class);
239239 $ extension ->findMany (['/foo ' , '/bar ' ], false , false );
240240 }
241241
@@ -255,14 +255,12 @@ public function testIsPublished()
255255 $ this ->assertTrue ($ this ->helper ->isPublished ($ document ));
256256 }
257257
258- /**
259- * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
260- */
261258 public function testIsPublishedNoWorkflow ()
262259 {
263260 $ extension = new Cmf (null );
264261 $ extension ->setDoctrineRegistry ($ this ->managerRegistry , 'foo ' );
265262
263+ $ this ->expectException (InvalidConfigurationException::class);
266264 $ extension ->isPublished (new \stdClass ());
267265 }
268266
0 commit comments