-
-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Unit tests for DataType class
- Loading branch information
Showing
1 changed file
with
51 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,51 @@ | ||
<?php | ||
class DataTypeTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
$this->datatype = new DataType(); | ||
} | ||
|
||
/** | ||
* testTooManyAttributes | ||
* | ||
* @expectedException BuildException | ||
* @expectedExceptionMessage You must not specify more than one attribute when using refid | ||
*/ | ||
public function testTooManyAttributes() | ||
{ | ||
$ex = $this->datatype->tooManyAttributes(); | ||
throw $ex; | ||
} | ||
|
||
/** | ||
* testNoChildrenAllowedException | ||
* | ||
* @expectedException BuildException | ||
* @expectedExceptionMessage You must not specify nested elements when using refid | ||
*/ | ||
public function testNoChildrenAllowedException() | ||
{ | ||
$ex = $this->datatype->noChildrenAllowed(); | ||
throw $ex; | ||
} | ||
|
||
/** | ||
* testCircularReferenceException | ||
* | ||
* @expectedException BuildException | ||
* @expectedExceptionMessage This data type contains a circular reference. | ||
*/ | ||
public function testCircularReferenceException() | ||
{ | ||
$ex = $this->datatype->circularReference(); | ||
throw $ex; | ||
} | ||
|
||
public function testToString() | ||
{ | ||
$str = ""; | ||
$str .= $this->datatype; | ||
$this->assertEquals("DataType", $str); | ||
} | ||
} |