예제 #1
0
 public function testGetSetData()
 {
     $view = new View();
     $this->assertEquals(array(), $view->getData());
     $view->setData(array('a' => 123, 'b' => 'abc'));
     $this->assertEquals(array('a' => 123, 'b' => 'abc'), $view->getData());
     $view->setData(array('a' => 1234, 'c' => 'c'));
     $this->assertEquals(array('a' => 1234, 'b' => 'abc', 'c' => 'c'), $view->getData());
     $this->assertEquals(1234, $view->a);
     $view->some = 'some-value';
     $this->assertEquals('some-value', $view->some);
     $this->assertEquals(null, $view->foo);
     $this->assertTrue(isset($view->a));
     $this->assertFalse(isset($view->aaa));
     unset($view->a);
     $this->assertFalse(isset($view->a));
 }