public function testGetJavaScriptWithAddedItem()
 {
     $input = ['id' => 'option_id3', 'label' => 'Option Three', 'url' => '*/*/option3', 'block_name' => 'admin.test.grid.massaction.option3'];
     $expected = '#"option_id3":{"id":"option_id3","label":"Option Three",' . '"url":"http:\\\\/\\\\/localhost\\\\/index\\.php\\\\/(?:key\\\\/([\\w\\d]+)\\\\/)?",' . '"block_name":"admin.test.grid.massaction.option3"}#';
     $this->_block->addItem($input['id'], $input);
     $this->assertRegExp($expected, $this->_block->getJavaScript());
 }
 /**
  * @param $itemId
  * @param $item
  * @param $expectedItem \Magento\Framework\DataObject
  * @dataProvider itemsDataProvider
  */
 public function testItemsProcessing($itemId, $item, $expectedItem)
 {
     $this->_urlModelMock->expects($this->any())->method('getBaseUrl')->will($this->returnValue('http://localhost/index.php'));
     $urlReturnValueMap = [['*/*/test1', [], 'http://localhost/index.php/backend/admin/test/test1'], ['*/*/test2', [], 'http://localhost/index.php/backend/admin/test/test2']];
     $this->_urlModelMock->expects($this->any())->method('getUrl')->will($this->returnValueMap($urlReturnValueMap));
     $this->_block->addItem($itemId, $item);
     $this->assertEquals(1, $this->_block->getCount());
     $actualItem = $this->_block->getItem($itemId);
     $this->assertInstanceOf('Magento\\Framework\\DataObject', $actualItem);
     $this->assertEquals($expectedItem->getData(), $actualItem->getData());
     $this->_block->removeItem($itemId);
     $this->assertEquals(0, $this->_block->getCount());
     $this->assertNull($this->_block->getItem($itemId));
 }