logic bug in build()
This commit is contained in:
parent
5a01664357
commit
3ed7e6a475
@ -84,7 +84,9 @@ class FixtureBuilder {
|
|||||||
function build() {
|
function build() {
|
||||||
if (!empty($this->current_object)) {
|
if (!empty($this->current_object)) {
|
||||||
$this->ensure_type($this->current_object['type']);
|
$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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,6 +210,8 @@ class FixtureBuilderTest extends PHPUnit_Framework_TestCase {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->assertTrue(!isset($builder->current_object));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testBuildEmpty() {
|
function testBuildEmpty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user