Example #1
0
 public function testFindAllItems()
 {
     $items_before = Item::GetAll();
     $item = Item::CreateAsset('Test Item Name Additional', 120, 10, '', 120);
     $items_after = Item::GetAll();
     $this->assertTrue(count($items_after) == count($items_before) + 1);
     foreach ($items_after as $itm) {
         $this->assertInstanceOf('Item', $itm);
     }
     Item::Delete($item->id);
     $post_after = Item::GetAll();
     $this->assertTrue(count($post_after) == count($items_before));
 }
Example #2
0
 public function allItems()
 {
     echo json_encode(Item::GetAll());
 }