Skip to content

Commit

Permalink
[ZF2-110] Added unit test in ZendTest\Code\Scanner\DocBlockScannerTes…
Browse files Browse the repository at this point in the history
…t to prove issue is fixed
  • Loading branch information
adamlundrigan committed Feb 23, 2012
1 parent e1a670c commit 3c71501
Showing 1 changed file with 52 additions and 6 deletions.
58 changes: 52 additions & 6 deletions tests/Zend/Code/Scanner/DocBlockScannerTest.php
@@ -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']);
}
}

0 comments on commit 3c71501

Please sign in to comment.