This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
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
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
tests/ZendTest/Code/Reflection/DocBlock/Tag/ThrowsTagTest.php
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,58 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace ZendTest\Code\Reflection\DocBlock\Tag; | ||
|
||
use Zend\Code\Reflection\DocBlock\Tag\ThrowsTag; | ||
|
||
/** | ||
* @group Zend_Reflection | ||
* @group Zend_Reflection_DocBlock | ||
*/ | ||
class ThrowsTagTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testAllCharactersFromTypenameAreSupported() | ||
{ | ||
$tag = new ThrowsTag(); | ||
$tag->initialize('\\Logic_2_Exception'); | ||
$this->assertEquals(array('\\Logic_2_Exception'), $tag->getTypes()); | ||
} | ||
|
||
public function testSingleTypeWithDescription() | ||
{ | ||
$tag = new ThrowsTag(); | ||
$tag->initialize('LogicException The Exception'); | ||
$this->assertEquals(array('LogicException'), $tag->getTypes()); | ||
$this->assertEquals('The Exception', $tag->getDescription()); | ||
} | ||
|
||
public function testSingleTypeWithoutDescription() | ||
{ | ||
$tag = new ThrowsTag(); | ||
$tag->initialize('LogicException'); | ||
$this->assertEquals(array('LogicException'), $tag->getTypes()); | ||
$this->assertNull($tag->getDescription()); | ||
} | ||
|
||
public function testMultipleTypesWithoutDescription() | ||
{ | ||
$tag = new ThrowsTag(); | ||
$tag->initialize('LogicException|RuntimeException'); | ||
$this->assertEquals(array('LogicException', 'RuntimeException'), $tag->getTypes()); | ||
$this->assertNull($tag->getDescription()); | ||
} | ||
|
||
public function testMultipleTypesWithDescription() | ||
{ | ||
$tag = new ThrowsTag(); | ||
$tag->initialize('LogicException|RuntimeException The Exception'); | ||
$this->assertEquals(array('LogicException', 'RuntimeException'), $tag->getTypes()); | ||
$this->assertEquals('The Exception', $tag->getDescription()); | ||
} | ||
} |