public function throwsWhenTryingToDefineNonexistentFields() { $self = $this; $this->assertThrows(function () use($self) { $self->factory->defineEntity('SpaceShip', array('pieType' => 'blueberry')); }); }