Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RepositoryControllerTest extends \Silex\WebTestCase
- {
- public function testGetAllAction()
- {
- $request = $this->getMock( 'Symfony\Component\HttpFoundation\Request' );
- $request = $this->getMock( 'Silex\Application' );
- $request->expects( $this->once() )
- ->method( 'offsetGet' ) // inside RepositoryController instead of $app['em'] use $app->offsetGet( 'em' )
- ->will( $this->returnValue( $this->getEntityManager() ) );
- $expected_results = json_encode( $you_know_this );
- $controller = new RepositoryController( $request, $app );
- $this->assertSame( $expected_results, $controller->getAllAction() );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement