1
0
mirror of synced 2025-01-05 16:53:21 +03:00
doctrine2/tests/AccessTestCase.class.php
doctrine 571cb46726
2006-04-13 20:37:28 +00:00

40 lines
1.2 KiB
PHP

<?php
class Doctrine_AccessTestCase extends Doctrine_UnitTestCase {
public function testOffsetMethods() {
$this->assertEqual($this->new["name"],null);
$this->new["name"] = "Jack";
$this->assertEqual($this->new["name"],"Jack");
$this->assertEqual($this->old["name"],"zYne");
$this->old["name"] = "Jack";
$this->assertEqual($this->old["name"],"Jack");
}
public function testOverload() {
$this->assertEqual($this->new->name,null);
$this->new->name = "Jack";
$this->assertEqual($this->new->name,"Jack");
$this->assertEqual($this->old->name,"zYne");
$this->old->name = "Jack";
$this->assertEqual($this->old->name,"Jack");
}
public function testSet() {
$this->assertEqual($this->new->get("name"),null);
$this->new->set("name","Jack");
$this->assertEqual($this->new->get("name"),"Jack");
$this->assertEqual($this->old->get("name"),"zYne");
$this->old->set("name","Jack");
$this->assertEqual($this->old->get("name"),"Jack");
$this->assertEqual($this->old->getID(),4);
}
}
?>