logic bug in build()

This commit is contained in:
John Bintz 2010-02-12 18:39:10 -05:00
parent 5a01664357
commit 3ed7e6a475
2 changed files with 5 additions and 1 deletions

View File

@ -84,7 +84,9 @@ class FixtureBuilder {
function build() {
if (!empty($this->current_object)) {
$this->ensure_type($this->current_object['type']);
return $this->{"build_{$this->current_object['type']}"}($this->current_object);
$result = $this->{"build_{$this->current_object['type']}"}($this->current_object);
unset($this->current_object);
return $result;
}
}

View File

@ -210,6 +210,8 @@ class FixtureBuilderTest extends PHPUnit_Framework_TestCase {
break;
}
}
$this->assertTrue(!isset($builder->current_object));
}
function testBuildEmpty() {