Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Make SeleniumTestCase compatible with Selenium IDE.

  Unfortunately, this breaks BC for getAttribute().
  • Loading branch information...
commit e51618a03e46d7eeffbb43b8e583184ee6fe168a 1 parent e2f449c
@sebastianbergmann authored
View
14 PHPUnit/Extensions/SeleniumTestCase.php
@@ -373,6 +373,7 @@ public function __call($command, $arguments)
break;
case 'getAlert':
+ case 'getAttribute':
case 'getBodyText':
case 'getConfirmation':
case 'getCookie':
@@ -420,19 +421,6 @@ public function __call($command, $arguments)
}
/**
- * The Selenium command "getAttribute" clashes with
- * PHPUnit_Framework_Assert::getAttribute().
- *
- * @param string $attributeLocator
- * @reutn string
- * @access public
- */
- public function getElementAttribute($attributeLocator)
- {
- return $this->getString('getAttribute', array($attributeLocator));
- }
-
- /**
* Asserts that an alert is present.
*
* @access public
View
22 PHPUnit/Framework/Assert.php
@@ -164,7 +164,7 @@ public static function assertAttributeContains($needle, $haystackAttributeName,
{
self::assertContains(
$needle,
- self::getAttribute($haystackClassOrObject, $haystackAttributeName),
+ self::readAttribute($haystackClassOrObject, $haystackAttributeName),
$message
);
}
@@ -217,7 +217,7 @@ public static function assertAttributeNotContains($needle, $haystackAttributeNam
{
self::assertNotContains(
$needle,
- self::getAttribute($haystackClassOrObject, $haystackAttributeName),
+ self::readAttribute($haystackClassOrObject, $haystackAttributeName),
$message
);
}
@@ -260,7 +260,7 @@ public static function assertAttributeEquals($expected, $actualAttributeName, $a
{
self::assertEquals(
$expected,
- self::getAttribute($actualClassOrObject, $actualAttributeName),
+ self::readAttribute($actualClassOrObject, $actualAttributeName),
$message,
$delta,
$maxDepth
@@ -308,7 +308,7 @@ public static function assertAttributeNotEquals($expected, $actualAttributeName,
{
self::assertNotEquals(
$expected,
- self::getAttribute($actualClassOrObject, $actualAttributeName),
+ self::readAttribute($actualClassOrObject, $actualAttributeName),
$message,
$delta,
$maxDepth
@@ -345,7 +345,7 @@ public static function assertAttributeGreaterThan($expected, $actualAttributeNam
{
self::assertGreaterThan(
$expected,
- self::getAttribute($actualClassOrObject, $actualAttributeName),
+ self::readAttribute($actualClassOrObject, $actualAttributeName),
$message
);
}
@@ -380,7 +380,7 @@ public static function assertAttributeGreaterThanOrEqual($expected, $actualAttri
{
self::assertGreaterThanOrEqual(
$expected,
- self::getAttribute($actualClassOrObject, $actualAttributeName),
+ self::readAttribute($actualClassOrObject, $actualAttributeName),
$message
);
}
@@ -415,7 +415,7 @@ public static function assertAttributeLessThan($expected, $actualAttributeName,
{
self::assertLessThan(
$expected,
- self::getAttribute($actualClassOrObject, $actualAttributeName),
+ self::readAttribute($actualClassOrObject, $actualAttributeName),
$message
);
}
@@ -450,7 +450,7 @@ public static function assertAttributeLessThanOrEqual($expected, $actualAttribut
{
self::assertLessThanOrEqual(
$expected,
- self::getAttribute($actualClassOrObject, $actualAttributeName),
+ self::readAttribute($actualClassOrObject, $actualAttributeName),
$message
);
}
@@ -736,7 +736,7 @@ public static function assertAttributeSame($expected, $actualAttributeName, $act
{
self::assertSame(
$expected,
- self::getAttribute($actualClassOrObject, $actualAttributeName),
+ self::readAttribute($actualClassOrObject, $actualAttributeName),
$message
);
}
@@ -776,7 +776,7 @@ public static function assertAttributeNotSame($expected, $actualAttributeName, $
{
self::assertNotSame(
$expected,
- self::getAttribute($actualClassOrObject, $actualAttributeName),
+ self::readAttribute($actualClassOrObject, $actualAttributeName),
$message
);
}
@@ -1273,7 +1273,7 @@ public static function fail($message = '')
* @access protected
* @static
*/
- public static function getAttribute($classOrObject, $attributeName)
+ public static function readAttribute($classOrObject, $attributeName)
{
if (!is_string($attributeName)) {
throw new InvalidArgumentException;
View
4 PHPUnit/Framework/Constraint/Attribute.php
@@ -83,7 +83,7 @@ public function __construct(PHPUnit_Framework_Constraint $constraint, $attribute
public function evaluate($other)
{
return $this->constraint->evaluate(
- PHPUnit_Framework_Assert::getAttribute(
+ PHPUnit_Framework_Assert::readAttribute(
$other, $this->attributeName
)
);
@@ -100,7 +100,7 @@ public function evaluate($other)
public function fail($other, $description, $not = FALSE)
{
parent::fail(
- PHPUnit_Framework_Assert::getAttribute(
+ PHPUnit_Framework_Assert::readAttribute(
$other, $this->attributeName
),
$description,
View
16 PHPUnit/Tests/Framework/AssertTest.php
@@ -1034,18 +1034,18 @@ public function testGetObjectAttribute()
{
$obj = new ClassWithNonPublicAttributes;
- $this->assertEquals('foo', $this->getAttribute($obj, 'publicAttribute'));
- $this->assertEquals('bar', $this->getAttribute($obj, 'protectedAttribute'));
- $this->assertEquals('baz', $this->getAttribute($obj, 'privateAttribute'));
- $this->assertEquals('parent', $this->getAttribute($obj, 'privateParentAttribute'));
+ $this->assertEquals('foo', $this->readAttribute($obj, 'publicAttribute'));
+ $this->assertEquals('bar', $this->readAttribute($obj, 'protectedAttribute'));
+ $this->assertEquals('baz', $this->readAttribute($obj, 'privateAttribute'));
+ $this->assertEquals('parent', $this->readAttribute($obj, 'privateParentAttribute'));
}
public function testGetStaticAttribute()
{
- $this->assertEquals('foo', $this->getAttribute('ClassWithNonPublicAttributes', 'publicStaticAttribute'));
- $this->assertEquals('bar', $this->getAttribute('ClassWithNonPublicAttributes', 'protectedStaticAttribute'));
- $this->assertEquals('baz', $this->getAttribute('ClassWithNonPublicAttributes', 'privateStaticAttribute'));
- $this->assertEquals('parent', $this->getAttribute('ClassWithNonPublicAttributes', 'privateStaticParentAttribute'));
+ $this->assertEquals('foo', $this->readAttribute('ClassWithNonPublicAttributes', 'publicStaticAttribute'));
+ $this->assertEquals('bar', $this->readAttribute('ClassWithNonPublicAttributes', 'protectedStaticAttribute'));
+ $this->assertEquals('baz', $this->readAttribute('ClassWithNonPublicAttributes', 'privateStaticAttribute'));
+ $this->assertEquals('parent', $this->readAttribute('ClassWithNonPublicAttributes', 'privateStaticParentAttribute'));
}
public function testAssertPublicAttributeContains()
Please sign in to comment.
Something went wrong with that request. Please try again.