Exemplo n.º 1
0
 public function testToArray()
 {
     $category = new Category(array('id' => 5, 'position' => 1, 'name' => 'Games', 'description' => 'Blogs relating to games'));
     $categoryAsArray = $category->toArray();
     $this->assertEquals(5, $categoryAsArray['id']);
     $this->assertEquals(1, $categoryAsArray['position']);
     $this->assertEquals('Games', $categoryAsArray['name']);
     $this->assertEquals('Blogs relating to games', $categoryAsArray['description']);
 }
Exemplo n.º 2
0
 public function setCategory(Category $category)
 {
     $category->addBlogEntry($this);
     $this->category = $category;
 }
 public function __get($name)
 {
     $this->__load();
     return parent::__get($name);
 }