Example #1
0
 public function testDataManger()
 {
     $this->assertNull($this->object->getData('x'));
     $this->assertEquals(1, $this->object->getData('x', 1));
     $this->object->setData('x', 2);
     $this->assertEquals(2, $this->object->getData('x'));
     $this->assertEquals(2, $this->object->getData('x', 1));
     $this->object->removeData('x');
     $this->assertNull($this->object->getData('x'));
     $this->object->setData('y', 'hello');
     $this->object->removeData('Y');
     $this->assertEquals('hello', $this->object->getData('y'));
     $this->assertFalse($this->object->isLogged());
     $this->object->setData('_logged', true);
     $this->assertNull($this->object->getData('_logged'));
     $this->assertFalse($this->object->isLogged());
     $this->object->setCurrentUser(1, 'test', array('teste'), array('a' => 1234));
     $this->assertTrue($this->object->isLogged());
     $this->assertNull($this->object->getData('_logged'));
     $this->object->removeData('_logged');
     $this->assertTrue($this->object->isLogged());
     $this->assertEquals(1234, $this->object->getData('a'));
 }