assertClassHasAttribute() public static method

Asserts that a class has a specified attribute.
public static assertClassHasAttribute ( string $attributeName, string $className, string $message = '' )
$attributeName string
$className string
$message string
Beispiel #1
0
/**
 * Asserts that a class has a specified attribute.
 *
 * @param  string $attributeName
 * @param  string $className
 * @param  string $message
 * @since  Method available since Release 3.1.0
 */
function assertClassHasAttribute($attributeName, $className, $message = '')
{
    return PHPUnit_Framework_Assert::assertClassHasAttribute($attributeName, $className, $message);
}
Beispiel #2
0
 public function hasAttribute($attribute)
 {
     if (is_string($attribute)) {
         a::assertClassHasAttribute($attribute, $this->actual, $this->description);
     } else {
         a::assertObjectHasAttribute($attribute, $this->actual, $this->description);
     }
 }
Beispiel #3
0
 /**
  * Expect that a class or an object has a specified attribute.
  *
  * @param string $attributeName
  * @param string $message
  *
  * @return Expect
  */
 public function toHaveAttribute($attributeName, $message = '')
 {
     if (is_string($this->value)) {
         // class
         Assert::assertClassHasAttribute($attributeName, $this->value, $message);
     } else {
         // object
         Assert::assertObjectHasAttribute($attributeName, $this->value, $message);
     }
     return $this;
 }
Beispiel #4
0
 public function hasAttribute($attribute)
 {
     Assert::assertClassHasAttribute($attribute, $this->actual, $this->description);
     return $this;
 }
 public function classToHaveAttribute($attributeName)
 {
     \PHPUnit_Framework_Assert::assertClassHasAttribute($attributeName, $this->actual);
 }
Beispiel #6
0
 public function shouldHaveAttribute($key)
 {
     Assert::assertClassHasAttribute($key, $this->it);
 }