public function setUp() { $this->column = $this->getMockBuilder('ZfcDatagrid\\Column\\Select')->disableOriginalConstructor()->getMock(); $this->column->method('getSelectPart1')->willReturn('myCol'); $this->column->method('getType')->willReturn(new \ZfcDatagrid\Column\Type\PhpString()); $this->column->setUniqueId('myCol'); $this->column->setSelect('myCol'); $this->column2 = $this->getMockBuilder('ZfcDatagrid\\Column\\Select')->disableOriginalConstructor()->getMock(); $this->column2->method('getSelectPart1')->willReturn('myCol2'); $this->column2->method('getType')->willReturn(new \ZfcDatagrid\Column\Type\PhpString()); $this->column2->setUniqueId('myCol2'); $this->column2->setSelect('myCol2'); $this->mockDriver = $this->getMock('Zend\\Db\\Adapter\\Driver\\DriverInterface'); $this->mockConnection = $this->getMock('Zend\\Db\\Adapter\\Driver\\ConnectionInterface'); $this->mockDriver->expects($this->any())->method('checkEnvironment')->will($this->returnValue(true)); $this->mockDriver->expects($this->any())->method('getConnection')->will($this->returnValue($this->mockConnection)); $this->mockPlatform = $this->getMock('Zend\\Db\\Adapter\\Platform\\PlatformInterface'); $this->mockStatement = $this->getMock('Zend\\Db\\Adapter\\Driver\\StatementInterface'); $this->mockDriver->expects($this->any())->method('createStatement')->will($this->returnValue($this->mockStatement)); $this->adapter = new Adapter($this->mockDriver, $this->mockPlatform); $sql = new Sql($this->adapter, 'foo'); $select = new Select('myTable'); $select->columns(['myCol', 'myCol2']); $this->filterSelect = new FilterSelect($sql, $select); }
public function setUp() { $this->colId = $this->getMockForAbstractClass('ZfcDatagrid\\Column\\AbstractColumn'); $this->colId->setUniqueId('id'); $this->colId->setIdentity(true); $this->col1 = $this->getMockForAbstractClass('ZfcDatagrid\\Column\\AbstractColumn'); $this->col1->setUniqueId('col1'); $this->col2 = $this->getMockForAbstractClass('ZfcDatagrid\\Column\\AbstractColumn'); $this->col2->setUniqueId('col2'); $this->col3 = $this->getMockForAbstractClass('ZfcDatagrid\\Column\\AbstractColumn'); $this->col3->setUniqueId('col3'); $this->col3->setType(new Type\PhpArray()); $data = []; $data[] = ['id' => '1', 'col1' => 'test', 'col2' => 'n', 'col3' => ['tag1', 'tag2']]; $data[] = ['id' => '2', 'col1' => 'test', 'col3' => ['tag3', 'tag1']]; $data[] = ['id' => '3', 'col1' => 'test', 'col2' => 'y', 'col3' => ['tag2', 'tag5']]; $this->data = $data; }
public function setUp() { $this->column = $this->getMockForAbstractClass('ZfcDatagrid\\Column\\AbstractColumn'); $this->column->setUniqueId('myCol'); $this->column->setSelect('myCol'); $this->column2 = $this->getMockForAbstractClass('ZfcDatagrid\\Column\\AbstractColumn'); $this->column2->setUniqueId('myCol2'); $this->column2->setSelect('myCol2'); $this->mockDriver = $this->getMock('Zend\\Db\\Adapter\\Driver\\DriverInterface'); $this->mockConnection = $this->getMock('Zend\\Db\\Adapter\\Driver\\ConnectionInterface'); $this->mockDriver->expects($this->any())->method('checkEnvironment')->will($this->returnValue(true)); $this->mockDriver->expects($this->any())->method('getConnection')->will($this->returnValue($this->mockConnection)); $this->mockPlatform = $this->getMock('Zend\\Db\\Adapter\\Platform\\PlatformInterface'); $this->mockStatement = $this->getMock('Zend\\Db\\Adapter\\Driver\\StatementInterface'); $this->mockDriver->expects($this->any())->method('createStatement')->will($this->returnValue($this->mockStatement)); $this->adapter = new Adapter($this->mockDriver, $this->mockPlatform); $sql = new Sql($this->adapter, 'foo'); $select = new Select('myTable'); $select->columns(['myCol', 'myCol2']); $this->filterSelect = new FilterSelect($sql, $select); }
public function setUp() { $this->column = $this->getMockForAbstractClass('ZfcDatagrid\\Column\\AbstractColumn'); $this->column->setUniqueId('colName'); }