Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

[ZF2-110] Added unit test in ZendTest\Code\Scanner\DocBlockScannerTest to prove issue is fixed #820

Merged
merged 1 commit into from Feb 24, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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']);
}
}