Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 23, 2012
  1. @adamlundrigan
This page is out of date. Refresh to see the latest.
Showing with 52 additions and 6 deletions.
  1. +52 −6 tests/Zend/Code/Scanner/DocBlockScannerTest.php
View
58 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']);
+ }
+}
Something went wrong with that request. Please try again.