-
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
2eb8982
commit a0a69ef
Showing
2 changed files
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace AmpProject\Exception; | ||
|
||
use AmpProject\Tests\TestCase; | ||
|
||
/** | ||
* Test the InvalidDeclarationName exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidDeclarationName | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidDeclarationNameTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for an invalid declaration name. | ||
*/ | ||
public function testThrowingForDeclarationName() | ||
{ | ||
$this->expectException(InvalidDeclarationName::class); | ||
$this->expectExceptionMessage( | ||
"Invalid declaration name 'declarationName' was requested from the validator spec." | ||
); | ||
|
||
throw InvalidDeclarationName::forDeclaration('declarationName'); | ||
} | ||
} |
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 InvalidDocRulesetName exception. | ||
* | ||
* @covers \AmpProject\Exception\InvalidDocRulesetName | ||
* @package ampproject/amp-toolbox | ||
*/ | ||
class InvalidDocRulesetNameTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test throwing the exception for a document ruleset name. | ||
*/ | ||
public function testThrowingForDocRulesetName() | ||
{ | ||
$this->expectException(InvalidDocRulesetName::class); | ||
$this->expectExceptionMessage("Invalid document ruleset name 'docName' was requested from the validator spec."); | ||
|
||
throw InvalidDocRulesetName::forDocRulesetName('docName'); | ||
} | ||
} |