/**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     // mock the adapter, driver, and parts
     $mockResult = $this->getMock('Zend\\Db\\Adapter\\Driver\\ResultInterface');
     $mockResult->expects($this->any())->method('getAffectedRows')->will($this->returnValue(5));
     $mockResult->expects($this->any())->method('current')->will($this->returnValue(5));
     $mockStatement = $this->getMock('Zend\\Db\\Adapter\\Driver\\StatementInterface');
     $mockStatement->expects($this->any())->method('execute')->will($this->returnValue($mockResult));
     $mockConnection = $this->getMock('Zend\\Db\\Adapter\\Driver\\ConnectionInterface');
     $mockConnection->expects($this->any())->method('getLastGeneratedValue')->will($this->returnValue(10));
     $mockDriver = $this->getMock('Zend\\Db\\Adapter\\Driver\\DriverInterface');
     $mockDriver->expects($this->any())->method('createStatement')->will($this->returnValue($mockStatement));
     $mockDriver->expects($this->any())->method('getConnection')->will($this->returnValue($mockConnection));
     $this->mockAdapter = $this->getMock('Zend\\Db\\Adapter\\Adapter', null, array($mockDriver));
     $this->mockSql = $this->getMock('Zend\\Db\\Sql\\Sql', array('select', 'insert', 'update', 'delete'), array($this->mockAdapter, 'foo'));
     $this->mockSql->expects($this->any())->method('select')->will($this->returnValue($this->getMock('Zend\\Db\\Sql\\Select', array('where', 'getRawSate'), array('foo'))));
     $this->mockSql->expects($this->any())->method('insert')->will($this->returnValue($this->getMock('Zend\\Db\\Sql\\Insert', array('prepareStatement', 'values'), array('foo'))));
     $this->mockSql->expects($this->any())->method('update')->will($this->returnValue($this->getMock('Zend\\Db\\Sql\\Update', array('where'), array('foo'))));
     $this->mockSql->expects($this->any())->method('delete')->will($this->returnValue($this->getMock('Zend\\Db\\Sql\\Delete', array('where'), array('foo'))));
     $this->table = $this->getMockForAbstractClass('VisioCrudModeler\\Model\\TableGateway\\AbstractTable', array($this->mockAdapter, 'test'));
     $tgReflection = new \ReflectionClass('VisioCrudModeler\\Model\\TableGateway\\AbstractTable');
     foreach ($tgReflection->getProperties() as $tgPropReflection) {
         $tgPropReflection->setAccessible(true);
         switch ($tgPropReflection->getName()) {
             case 'adapter':
                 $tgPropReflection->setValue($this->table, $this->mockAdapter);
                 break;
             case 'sql':
                 $tgPropReflection->setValue($this->table, $this->mockSql);
                 break;
             case 'keyName':
                 $tgPropReflection->setValue($this->table, 'id');
                 break;
             case 'table':
                 $tgPropReflection->setValue($this->table, 'foo');
                 break;
         }
     }
     $this->entity = $this->getMock('VisioCrudModeler\\Model\\TableGateway\\Entity\\AbstractEntity');
     $this->entity->expects($this->any())->method('getArrayCopy')->will($this->returnValue(array('id' => 5, 'foo' => 'bar')));
 }
 public function testGetInputFilter()
 {
     $this->assertInstanceOf('\\Zend\\InputFilter\\InputFilterInterface', $this->entity->getInputFilter());
 }