Server IP : 172.67.157.199 / Your IP : 52.15.166.205 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/wp-all-export/src/App/Categories/ |
Upload File : |
<?php class CategoriesCollectionTest extends \PHPUnit_Framework_TestCase { public function testItCanBeInitiated() { $categories = array('id' => 0, 'title' => 'Root', 'children' => array(0 => array('id' => 33, 'title' => 'Animal Supplies', 'children' => array(0 => array('id' => 35, 'title' => 'Peeet Supplies', 'children' => array(0 => array('id' => 36, 'title' => 'Pet Doors', 'children' => array(), 'selectedCategory' => 'Cameras & Optics', 'selectedCategoryId' => '141',),), 'selectedCategory' => 'Cameras & Optics', 'selectedCategoryId' => '141',),), 'selectedCategory' => 'Cameras & Optics', 'selectedCategoryId' => '141',), 1 => array('id' => 23, 'title' => 'Clothes', 'children' => array(0 => array('id' => 24, 'title' => 'Shirts', 'children' => array(), 'selectedCategory' => 'Cameras & Optics', 'selectedCategoryId' => '141',),), 'selectedCategory' => 'Cameras & Optics', 'selectedCategoryId' => '141',), 2 => array('id' => 37, 'title' => 'Furniture', 'children' => array(0 => array('id' => 38, 'title' => 'Chairs', 'children' => array(0 => array('id' => 39, 'title' => 'Bean bag chair', 'children' => array(), 'selectedCategory' => 'Apparel & Accessories', 'selectedCategoryId' => '166',),), 'selectedCategory' => 'Apparel & Accessories', 'selectedCategoryId' => '166',),), 'selectedCategory' => 'Apparel & Accessories', 'selectedCategoryId' => '166',), 3 => array('id' => 26, 'title' => 'Head wear', 'children' => array(0 => array('id' => 28, 'title' => 'Glasses', 'children' => array(), 'selectedCategory' => 'Cameras & Optics', 'selectedCategoryId' => '141',), 1 => array('id' => 27, 'title' => 'Hats', 'children' => array(), 'selectedCategory' => 'Cameras & Optics', 'selectedCategoryId' => '141',),), 'selectedCategory' => 'Cameras & Optics', 'selectedCategoryId' => '141',), 4 => array('id' => 29, 'title' => 'Kitchen', 'children' => array(0 => array('id' => 30, 'title' => 'Mugs', 'children' => array(), 'selectedCategory' => 'Business & Industrial', 'selectedCategoryId' => '111',),), 'selectedCategory' => 'Business & Industrial', 'selectedCategoryId' => '111',), 5 => array('id' => 34, 'title' => 'Pet Supplies', 'children' => array(), 'selectedCategory' => 'Apparel & Accessories', 'selectedCategoryId' => '166',),),); $categoriesCollection = new \Wpae\App\Categories\CategoriesCollection($categories); $this->assertInstanceOf(\Wpae\App\Categories\CategoriesCollection::class, $categoriesCollection); $cat = $categoriesCollection->findCategory('Mugs'); print_r($cat); } }