Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. class RepositoryControllerTest extends \Silex\WebTestCase
  2. {
  3.  
  4.     public function testGetAllAction()
  5.     {
  6.         $request = $this->getMock( 'Symfony\Component\HttpFoundation\Request' );
  7.        
  8.         $request = $this->getMock( 'Silex\Application' );
  9.         $request->expects( $this->once() )
  10.              ->method( 'offsetGet' ) // inside RepositoryController instead of $app['em'] use $app->offsetGet( 'em' )
  11.              ->will( $this->returnValue( $this->getEntityManager() ) );
  12.         $expected_results = json_encode( $you_know_this );
  13.  
  14.         $controller = new RepositoryController( $request, $app );
  15.        
  16.         $this->assertSame( $expected_results, $controller->getAllAction() );
  17.    }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement