public function testGetCommentTableReturnsAnInstanceOfCommentTable() { $tableGatewayMock = $this->getMock('Zend\\Db\\TableGateway\\TableGateway', array(), array(), '', false); $commentTable = new CommentTable($tableGatewayMock); $this->serviceLocatorMock->expects($this->once())->method('get')->with('RbComment\\Model\\CommentTable')->will($this->returnValue($commentTable)); $commentController = new CommentController(); $commentController->setServiceLocator($this->serviceLocatorMock); $this->assertEquals($commentTable, $commentController->getCommentTable()); $this->assertInstanceOf('RbComment\\Model\\CommentTable', $commentController->getCommentTable()); }