public function testCreate() { $item = Item::create($this->library, 'todo'); $this->assertEquals('todo', $item->type()); $this->assertEquals('draft', $item->status()); // search for the item in the library $this->assertEquals($item, $this->library->find($item->id)); }
public function rebuild() { foreach ($this->folder()->children() as $year) { foreach ($year->children() as $month) { foreach ($month->children() as $day) { foreach ($day->children() as $item) { $data = data::read($item->root() . DS . 'item.yaml'); $item = new Item($this, $data['type'], $data); $item->store(); } } } } }