-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b284a31
commit dc29a61
Showing
15 changed files
with
230 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidAttributeName exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidAttributeName | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidAttributeNameTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for an attribute. | ||
*/ | ||
public function testThrowingForAttribute() | ||
{ | ||
$this->expectException(InvalidAttributeName::class); | ||
$this->expectExceptionMessage("Invalid attribute 'attributeName' was requested from the validator spec."); | ||
|
||
throw InvalidAttributeName::forAttribute('attributeName'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidCssName exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidCssName | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidCssNameTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for a CSS name. | ||
*/ | ||
public function testThrowingForCssName() | ||
{ | ||
$this->expectException(InvalidCssName::class); | ||
$this->expectExceptionMessage("Invalid css name 'cssName' was requested from the validator spec."); | ||
|
||
throw InvalidCssName::forCssName('cssName'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidExtension exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidExtension | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidExtensionTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for an extension. | ||
*/ | ||
public function testThrowingForExtension() | ||
{ | ||
$this->expectException(InvalidExtension::class); | ||
$this->expectExceptionMessage("Invalid extension 'extensionName' was requested from the validator spec."); | ||
|
||
throw InvalidExtension::forExtension('extensionName'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidFormat exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidFormat | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidFormatTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for an format. | ||
*/ | ||
public function testThrowingForFormat() | ||
{ | ||
$this->expectException(InvalidFormat::class); | ||
$this->expectExceptionMessage("Invalid format 'formatName' was requested from the validator spec."); | ||
|
||
throw InvalidFormat::forFormat('formatName'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidListName exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidListName | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidListNameTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for an attribute list. | ||
*/ | ||
public function testThrowingForAttributeList() | ||
{ | ||
$this->expectException(InvalidListName::class); | ||
$this->expectExceptionMessage( | ||
"Invalid attribute list 'attributeListName' was requested from the validator spec." | ||
); | ||
|
||
throw InvalidListName::forAttributeList('attributeListName'); | ||
} | ||
|
||
/** | ||
* Test throwing the exception for an declaration list. | ||
*/ | ||
public function testThrowingForDeclarationList() | ||
{ | ||
$this->expectException(InvalidListName::class); | ||
$this->expectExceptionMessage( | ||
"Invalid declaration list 'declarationListName' was requested from the validator spec." | ||
); | ||
|
||
throw InvalidListName::forDeclarationList('declarationListName'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidSpecName exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidSpecName | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidSpecNameTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for a spec name. | ||
*/ | ||
public function testThrowingForSpecName() | ||
{ | ||
$this->expectException(InvalidSpecName::class); | ||
$this->expectExceptionMessage("Invalid spec name 'specName' was requested from the validator spec."); | ||
|
||
throw InvalidSpecName::forSpecName('specName'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidSpecRuleName exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidSpecRuleName | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidSpecRuleNameTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for a spec rule name. | ||
*/ | ||
public function testThrowingForSpecRuleName() | ||
{ | ||
$this->expectException(InvalidSpecRuleName::class); | ||
$this->expectExceptionMessage("Invalid spec rule name 'specRuleName' was requested from the validator spec."); | ||
|
||
throw InvalidSpecRuleName::forSpecRuleName('specRuleName'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidTagId exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidTagId | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidTagIdTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for a tag ID. | ||
*/ | ||
public function testThrowingForTagId() | ||
{ | ||
$this->expectException(InvalidTagId::class); | ||
$this->expectExceptionMessage("Invalid tag ID 'tagId' was requested from the validator tag."); | ||
|
||
throw InvalidTagId::forTagId('tagId'); | ||
} | ||
} |