/** * @param array $items * @param string $result * * @dataProvider dataProviderGetGridIdsJsonWithUseSelectAll */ public function testGetGridIdsJsonWithUseSelectAll(array $items, $result) { $this->_block->setUseSelectAll(true); $collectionMock = $this->getMockBuilder('Magento\\Framework\\Data\\Collection')->disableOriginalConstructor()->getMock(); $this->_gridMock->expects($this->once())->method('getCollection')->willReturn($collectionMock); $collectionMock->expects($this->once())->method('clear')->willReturnSelf(); $collectionMock->expects($this->once())->method('setPageSize')->with(0)->willReturnSelf(); $collectionMock->expects($this->once())->method('getAllIds')->willReturn($items); $this->assertEquals($result, $this->_block->getGridIdsJson()); }
public function testUseSelectAll() { $this->_block->setUseSelectAll(false); $this->assertFalse($this->_block->getUseSelectAll()); $this->_block->setUseSelectAll(true); $this->assertTrue($this->_block->getUseSelectAll()); }