What's wrong here...
Posted: Sat Jul 30, 2005 2:54 pm
This test passes:
this one fails
with
The relevant bit of production code
Code: Select all
function TestRegistrySingeleton() {
$this->assertReference(Registry::instance(),
Registry::instance());
}Code: Select all
function setUp() {
$this->testReg = Registry::instance();
}
function TestRegistrySingeleton() {
$this->assertReference($this->testReg,
Registry::instance());
}Code: Select all
Fail: /usr/local/CIB/main-dev/compinabox/tests/unit-tests/classes/All.php ->
All Class Tests -> /usr/local/CIB/main-dev/compinabox/tests/unit-tests/classes/Registry/All.php ->
All Registry Tests -> /usr/local/CIB/main-dev/compinabox/tests/unit-tests/classes/Registry/BasicRegistryTests.php ->
Registry -- Interface ->
testregistrysingeleton ->
їObject: of registry] and
їObject: of registry] should reference the same object at line ї33]The relevant bit of production code
Code: Select all
function &instance() {
static $theInstance=false;
if (!$theInstance) $theInstance = new Registry();
return $theInstance;
}