public function testCreate() { $directory = new FooDirectory($this->getMongoDB()); $model = $directory->create(['memoryOnly' => 'yes']); PHPUnit::assertObjectNotHasAttribute('_id', $model); PHPUnit::assertEquals('yes', $model['memoryOnly']); }
/** * Asserts that an object does not have a specified attribute. * * @param string $attributeName * @param object $object * @param string $message * @since Method available since Release 3.0.0 */ function assertObjectNotHasAttribute($attributeName, $object, $message = '') { return PHPUnit_Framework_Assert::assertObjectNotHasAttribute($attributeName, $object, $message); }
public function notHasAttribute($attribute) { if (is_string($attribute)) { a::assertClassNotHasAttribute($attribute, $this->actual, $this->description); } else { a::assertObjectNotHasAttribute($attribute, $this->actual, $this->description); } }
/** * Expect that a class or an object does not have a specified attribute. * * @param string $attributeName * @param string $message * * @return Expect */ public function notToHaveAttribute($attributeName, $message = '') { if (is_string($this->value)) { // class Assert::assertClassNotHasAttribute($attributeName, $this->value, $message); } else { // object Assert::assertObjectNotHasAttribute($attributeName, $this->value, $message); } return $this; }
public function toNotHaveAttribute($attributeName) { \PHPUnit_Framework_Assert::assertObjectNotHasAttribute($attributeName, $this->actual); }
public function doesNotHaveAttribute($attribute) { Assert::assertObjectNotHasAttribute($attribute, $this->actual, $this->description); return $this; }