assertObjectNotHasAttribute() public static method

Asserts that an object does not have a specified attribute.
public static assertObjectNotHasAttribute ( string $attributeName, object $object, string $message = '' )
$attributeName string
$object object
$message string
Ejemplo n.º 1
0
 public function testCreate()
 {
     $directory = new FooDirectory($this->getMongoDB());
     $model = $directory->create(['memoryOnly' => 'yes']);
     PHPUnit::assertObjectNotHasAttribute('_id', $model);
     PHPUnit::assertEquals('yes', $model['memoryOnly']);
 }
Ejemplo n.º 2
0
/**
 * 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);
}
Ejemplo n.º 3
0
 public function notHasAttribute($attribute)
 {
     if (is_string($attribute)) {
         a::assertClassNotHasAttribute($attribute, $this->actual, $this->description);
     } else {
         a::assertObjectNotHasAttribute($attribute, $this->actual, $this->description);
     }
 }
Ejemplo n.º 4
0
 /**
  * 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;
 }
Ejemplo n.º 5
0
 public function toNotHaveAttribute($attributeName)
 {
     \PHPUnit_Framework_Assert::assertObjectNotHasAttribute($attributeName, $this->actual);
 }
Ejemplo n.º 6
0
 public function doesNotHaveAttribute($attribute)
 {
     Assert::assertObjectNotHasAttribute($attribute, $this->actual, $this->description);
     return $this;
 }