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
4ff8dd0
commit 31abe4e
Showing
2 changed files
with
53 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
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 League\CommonMark\Tests\Unit\Inline\Element; | ||
|
||
use League\CommonMark\Inline\Element\AbstractWebResource; | ||
|
||
class AbstractWebResourceTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Tests the URL constructor parameter and getUrl() method | ||
*/ | ||
public function testConstructorAndGetUrl() | ||
{ | ||
$url = 'https://www.example.com/foo'; | ||
|
||
/** @var AbstractWebResource $element */ | ||
$element = $this->getMockBuilder('League\\CommonMark\\Inline\\Element\\AbstractWebResource') | ||
->setConstructorArgs([$url]) | ||
->getMockForAbstractClass(); | ||
|
||
$this->assertEquals($url, $element->getUrl()); | ||
} | ||
|
||
/** | ||
* Tests the setUrl() method | ||
*/ | ||
public function testSetUrl() | ||
{ | ||
$url1 = 'https://www.example.com/foo'; | ||
$url2 = 'https://www.example.com/bar'; | ||
|
||
/** @var AbstractWebResource $element */ | ||
$element = $this->getMockBuilder('League\\CommonMark\\Inline\\Element\\AbstractWebResource') | ||
->setConstructorArgs([$url1]) | ||
->getMockForAbstractClass(); | ||
|
||
$element->setUrl($url2); | ||
|
||
$this->assertEquals($url2, $element->getUrl()); | ||
} | ||
} |