Exemple #1
0
 /**
  * @magentoDataFixture Magento/Catalog/_files/categories.php
  */
 public function testGetTreeJson()
 {
     $jsonTree = $this->block->getTreeJson();
     $this->assertContains('Default Category (4)', $jsonTree);
     $this->assertContains('Category 1.1 (2)', $jsonTree);
     $this->assertContains('Category 1.1.1 (1)', $jsonTree);
     $this->assertContains('Category 2 (0)', $jsonTree);
     $this->assertContains('Movable (0)', $jsonTree);
     $this->assertContains('Movable Position 1 (0)', $jsonTree);
     $this->assertContains('Movable Position 2 (2)', $jsonTree);
     $this->assertContains('Movable Position 3 (2)', $jsonTree);
     $this->assertContains('Category 12 (2)', $jsonTree);
     $this->assertStringMatchesFormat('%s"path":"1\\/2\\/%s\\/%s\\/%s"%s', $jsonTree);
 }
Exemple #2
0
 /**
  * @magentoDataFixture Magento/Catalog/_files/categories.php
  */
 public function testGetTreeJson()
 {
     $jsonTree = $this->_block->getTreeJson();
     $this->assertContains('Default Category (1)', $jsonTree);
     $this->assertContains('Category 1.1 (2)', $jsonTree);
     $this->assertContains('Category 1.1.1 (1)', $jsonTree);
     $this->assertContains('Category 2 (0)', $jsonTree);
     $this->assertContains('Movable (0)', $jsonTree);
     $this->assertContains('Movable Position 1 (0)', $jsonTree);
     $this->assertContains('Movable Position 2 (2)', $jsonTree);
     $this->assertContains('Movable Position 3 (2)', $jsonTree);
     $this->assertContains('Category 12 (2)', $jsonTree);
     $this->assertContains('"path":"1\\/2\\/3\\/4\\/5"', $jsonTree);
 }