This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ZF2-110] Added unit test in ZendTest\Code\Scanner\DocBlockScannerTes…
…t to prove issue is fixed
- Loading branch information
1 parent
e1a670c
commit 3c71501
Showing
1 changed file
with
52 additions
and
6 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 |
---|---|---|
@@ -1,9 +1,55 @@ | ||
<?php | ||
/** | ||
* Created by JetBrains PhpStorm. | ||
* User: ralphschindler | ||
* Date: 9/28/11 | ||
* Time: 1:58 PM | ||
* To change this template use File | Settings | File Templates. | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to license@zend.com so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Code_Scanner | ||
* @subpackage UnitTests | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
|
||
namespace ZendTest\Code\Scanner; | ||
|
||
use Zend\Code\Scanner\DocBlockScanner, | ||
PHPUnit_Framework_TestCase as TestCase; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Code_Scanner | ||
* @subpackage UnitTests | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @group Zend_Code_Scanner | ||
*/ | ||
class DocBlockScannerTest extends TestCase | ||
{ | ||
/** | ||
* @group ZF2-110 | ||
*/ | ||
public function testDocBlockScannerParsesTagsWithNoValuesProperly() | ||
{ | ||
$docComment = <<<EOB | ||
/** | ||
* @mytag | ||
*/ | ||
EOB; | ||
$tokenScanner = new DocBlockScanner($docComment); | ||
$tags = $tokenScanner->getTags(); | ||
$this->assertCount(1, $tags); | ||
$this->assertArrayHasKey('name', $tags[0]); | ||
$this->assertEquals('@mytag', $tags[0]['name']); | ||
$this->assertArrayHasKey('value', $tags[0]); | ||
$this->assertEquals('', $tags[0]['value']); | ||
} | ||
} |