Permalink
Browse files

Removing unit tests of DocBlock component (has moved to component) an…

…d altered phpunit config to skip vendor folder when checking coverage
  • Loading branch information...
1 parent 98f9037 commit 6d93f8575e6bc8aa9214dc89c5e932da2af161eb @mvriel mvriel committed Apr 7, 2012
View
69 phpunit.xml.dist
@@ -1,41 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="tests/common/bootstrap.php" colors="true" strict="true">
- <testsuites>
- <testsuite name="phpDocumentor">
- <directory>./tests/unit/</directory>
- <directory suffix=".phpt">./tests/ui/</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist>
- <directory suffix=".php">.</directory>
- <exclude>
- <directory suffix=".php">build</directory>
- <directory suffix=".php">src/markdown</directory>
- <file>src/markdown.php</file>
- <directory suffix=".php">src/Zend</directory>
- <directory suffix=".php">src/ZendX</directory>
- <directory suffix=".php">src/XHProf</directory>
- <directory suffix=".php">src/symfony</directory>
- <directory suffix=".php">data/output</directory>
- <directory suffix=".php">data/log</directory>
- <directory suffix=".php">tests</directory>
- <directory suffix=".php">bin</directory>
- <directory suffix=".php">data</directory>
- </exclude>
- </whitelist>
- </filter>
- <logging>
- <log type="coverage-html"
- title="phpDocumentor"
- target="build/coverage"
- charset="UTF-8"
- yui="true"
- highlight="false"
- lowUpperBound="35"
- highLowerBound="70" />
- <log type="coverage-clover" target="build/logs/clover.xml" />
- <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false" />
- </logging>
+ <testsuites>
+ <testsuite name="phpDocumentor">
+ <directory>./tests/unit/</directory>
+ <directory suffix=".phpt">./tests/ui/</directory>
+ </testsuite>
+ </testsuites>
+ <filter>
+ <whitelist>
+ <directory suffix=".php">.</directory>
+ <exclude>
+ <directory suffix=".php">build</directory>
+ <directory suffix=".php">data</directory>
+ <directory suffix=".php">tests</directory>
+ <directory suffix=".php">bin</directory>
+ <directory suffix=".php">vendor</directory>
+ <directory suffix=".php">src/Zend</directory>
+ <directory suffix=".php">src/XHProf</directory>
+ </exclude>
+ </whitelist>
+ </filter>
+ <logging>
+ <log type="coverage-html"
+ title="phpDocumentor"
+ target="build/coverage"
+ charset="UTF-8"
+ yui="true"
+ highlight="false"
+ lowUpperBound="35"
+ highLowerBound="70" />
+ <log type="coverage-clover" target="build/logs/clover.xml" />
+ <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false" />
+ </logging>
</phpunit>
View
209 tests/unit/phpDocumentor/Reflection/DocBlockTest.php
@@ -1,209 +0,0 @@
-<?php
-/**
- * phpDocumentor
- *
- * PHP Version 5
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Mike van Riel <mike.vanriel@naenius.com>
- * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
- * @license http://www.opensource.org/licenses/mit-license.php MIT
- * @link http://phpdoc.org
- */
-
-/**
- * Test class for phpDocumentor_Reflection_DocBlock.
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Mike van Riel <mike.vanriel@naenius.com>
- * @license http://www.opensource.org/licenses/mit-license.php MIT
- * @link http://phpdoc.org
- */
-class phpDocumentor_Reflection_DocBlockTest extends PHPUnit_Framework_TestCase
-{
- /** @var array[] tokens returned by token_get_all */
- protected $tokens = array();
-
- /**
- * @var phpDocumentor_Reflection_File
- */
- protected $fixture = null;
-
- /**
- * Sets up the fixture.
- *
- * This method is called before a test is executed.
- *
- * @return void
- */
- protected function setUp()
- {
- $this->fixture = new phpDocumentor_Reflection_File(dirname(__FILE__) . '/../../../data/DocBlockFixture.php');
- $this->fixture->process();
- }
-
- /**
- * Tests the EmptyDocBlock scenario.
- *
- * @return void
- */
- public function testConstruct_EmptyDocBlock()
- {
- /** @var phpDocumentor_Reflection_Class $class */
- $class = $this->fixture->getClass('phpDocumentor_Tests_Data_DocBlockFixture');
- $this->assertInstanceOf('phpDocumentor_Reflection_Class', $class);
-
- /** @var phpDocumentor_Reflection_Method $method */
- $method = $class->getMethod('EmptyDocBlock');
-
- $this->assertEquals('', $method->getDocBlock()->getShortDescription());
- $this->assertEquals('', trim($method->getDocBlock()->getLongDescription()->getContents()));
- $this->assertFalse(current($method->getDocBlock()->getTagsByName('param')));
- }
-
- /**
- * Tests the ReallyEmptyDocBlock scenario.
- *
- * @return void
- */
- public function testConstruct_ReallyEmptyDocBlock()
- {
- /** @var phpDocumentor_Reflection_Class $class */
- $class = $this->fixture->getClass('phpDocumentor_Tests_Data_DocBlockFixture');
- $this->assertInstanceOf('phpDocumentor_Reflection_Class', $class);
-
- /** @var phpDocumentor_Reflection_Method $method */
- $method = $class->getMethod('ReallyEmptyDocBlock');
-
- $this->assertEquals('', $method->getDocBlock()->getShortDescription());
- $this->assertEquals('', trim($method->getDocBlock()->getLongDescription()->getContents()));
- $this->assertFalse(current($method->getDocBlock()->getTagsByName('param')));
- }
-
- /**
- * Tests the SingleLineDocBlock scenario.
- *
- * @return void
- */
- public function testConstruct_SingleLineDocBlock()
- {
- /** @var phpDocumentor_Reflection_Class $class */
- $class = $this->fixture->getClass('phpDocumentor_Tests_Data_DocBlockFixture');
- $this->assertInstanceOf('phpDocumentor_Reflection_Class', $class);
-
- /** @var phpDocumentor_Reflection_Method $method */
- $method = $class->getMethod('SingleLineDocBlock');
-
- $this->assertEquals('Single line docblock.', $method->getDocBlock()->getShortDescription());
- $this->assertEquals('', trim($method->getDocBlock()->getLongDescription()->getContents()));
- $this->assertFalse(current($method->getDocBlock()->getTagsByName('param')));
- }
-
- /**
- * Tests the SingleLineDocBlock2 scenario.
- *
- * @return void
- */
- public function testConstruct_SingleLineDocBlock2()
- {
- /** @var phpDocumentor_Reflection_Class $class */
- $class = $this->fixture->getClass('phpDocumentor_Tests_Data_DocBlockFixture');
- $this->assertInstanceOf('phpDocumentor_Reflection_Class', $class);
-
- /** @var phpDocumentor_Reflection_Method $method */
- $method = $class->getMethod('SingleLineDocBlock2');
-
- $this->assertEquals('Single line docblock.', $method->getDocBlock()->getShortDescription());
- $this->assertEquals('', trim($method->getDocBlock()->getLongDescription()->getContents()));
- $this->assertFalse(current($method->getDocBlock()->getTagsByName('param')));
- }
-
- /**
- * Tests the SimpleDocBlockWithLD scenario.
- *
- * @return void
- */
- public function testConstruct_SimpleDocBlockWithLD()
- {
- /** @var phpDocumentor_Reflection_Class $class */
- $class = $this->fixture->getClass('phpDocumentor_Tests_Data_DocBlockFixture');
- $this->assertInstanceOf('phpDocumentor_Reflection_Class', $class);
-
- /** @var phpDocumentor_Reflection_Method $method */
- $method = $class->getMethod('SimpleDocBlockWithLD');
-
- $this->assertEquals('Single line docblock.', $method->getDocBlock()->getShortDescription());
- $this->assertEquals('Long description.', trim($method->getDocBlock()->getLongDescription()->getContents()));
- $this->assertEquals('Long description.', trim($method->getDocBlock()->getLongDescription()->getFormattedContents()));
- $this->assertFalse(current($method->getDocBlock()->getTagsByName('param')));
- }
-
- /**
- * Tests the IdealDocBlock scenario.
- *
- * @return void
- */
- public function testConstruct_IdealDocBlock()
- {
- /** @var phpDocumentor_Reflection_Class $class */
- $class = $this->fixture->getClass('phpDocumentor_Tests_Data_DocBlockFixture');
- $this->assertInstanceOf('phpDocumentor_Reflection_Class', $class);
-
- /** @var phpDocumentor_Reflection_Method $method */
- $method = $class->getMethod('IdealDocBlock');
-
- $this->assertEquals(
- "This docblock is the ideal situation, short descriptions are single line and closed with a point.",
- $method->getDocBlock()->getShortDescription()
- );
-
- $this->assertEquals(<<<LD
-The long description is separated a whiteline away and has a trailing whiteline. After which each
-tag 'group' is separated by a whiteline.
-LD
- ,
- trim($method->getDocBlock()->getLongDescription()->getContents())
- );
-
- $this->assertEquals(<<<LD
-The long description is separated a whiteline away and has a trailing whiteline. After which each
-tag 'group' is separated by a whiteline.
-LD
- ,
- trim($method->getDocBlock()->getLongDescription()->getFormattedContents())
- );
-
- $this->assertInstanceOf('phpDocumentor_Reflection_DocBlock_Tag_Param', current($method->getDocBlock()->getTagsByName('param')));
- $this->assertEquals('$object', current($method->getDocBlock()->getTagsByName('param'))->getVariableName());
- $this->assertEquals('ArrayObject', current($method->getDocBlock()->getTagsByName('param'))->getType());
- }
-
- /**
- * Tests the DocBlockWithInvalidShortDescription scenario.
- *
- * @return void
- */
- public function testConstruct_DocBlockWithInvalidShortDescription()
- {
- /** @var phpDocumentor_Reflection_Class $class */
- $class = $this->fixture->getClass('phpDocumentor_Tests_Data_DocBlockFixture');
- $this->assertInstanceOf('phpDocumentor_Reflection_Class', $class);
-
- /** @var phpDocumentor_Reflection_Method $method */
- $method = $class->getMethod('DocBlockWithInvalidShortDescription');
-
- $this->assertEquals(
- "This docblock is invalid because the short description 'does not end'",
- $method->getDocBlock()->getShortDescription()
- );
- $this->assertEquals('', trim($method->getDocBlock()->getLongDescription()->getContents()));
- $this->assertInstanceOf('phpDocumentor_Reflection_DocBlock_Tag_Param', current($method->getDocBlock()->getTagsByName('param')));
- $this->assertEquals('$object', current($method->getDocBlock()->getTagsByName('param'))->getVariableName());
- $this->assertEquals('ArrayObject', current($method->getDocBlock()->getTagsByName('param'))->getType());
- }
-
-}
View
90 tests/unit/phpDocumentor/Reflection/Tag/CoversTest.php
@@ -1,90 +0,0 @@
-<?php
-/**
- * phpDocumentor Covers Tag Test
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Daniel O'Connor <daniel.oconnor@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-
-/**
- * Test class for phpDocumentor_Reflection_DocBlock_Tag_Covers
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Daniel O'Connor <daniel.oconnor@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-class phpDocumentor_Reflection_DocBlock_Tag_CoversTest extends PHPUnit_Framework_TestCase
-{
- /**
- * Test that the phpDocumentor_Reflection_DocBlock_Tag_Covers can create a link
- * for the covers doc block
- *
- * @param string $type
- * @param string $content
- * @param string $exName
- * @param string $exContent
- * @param string $exReference
- *
- * @covers phpDocumentor_Reflection_DocBlock_Tag_Covers::__construct
- * @dataProvider provideDataForConstuctor
- *
- * @return void
- */
- public function testConstructorParesInputsIntoCorrectFields(
- $type, $content, $exName, $exContent, $exDescription, $exReference
- )
- {
- $tag = new phpDocumentor_Reflection_DocBlock_Tag_Covers($type, $content);
-
- $actualName = $tag->getName();
- $actualContent = $tag->getContent();
- $actualDescription = $tag->getDescription();
- $actualReference = $tag->getReference();
-
- $this->assertEquals($exName, $actualName);
- $this->assertEquals($exContent, $actualContent);
- $this->assertEquals($exDescription, $actualDescription);
- $this->assertEquals($exReference, $actualReference);
- }
-
- /**
- * Data provider for testConstructorParesInputsIntoCorrectFields
- *
- * @return array
- */
- public function provideDataForConstuctor()
- {
- // $type, $content, $exName, $exContent, $exDescription, $exReference
- return array(
- array(
- 'uses',
- 'Foo::bar()',
- 'uses',
- 'Foo::bar()',
- '',
- 'Foo::bar()'
- ),
- array(
- 'uses',
- 'Foo::bar() Testing',
- 'uses',
- 'Foo::bar() Testing',
- 'Testing',
- 'Foo::bar()',
- ),
- array(
- 'uses',
- 'Foo::bar() Testing comments',
- 'uses',
- 'Foo::bar() Testing comments',
- 'Testing comments',
- 'Foo::bar()',
- ),
- );
- }
-}
View
91 tests/unit/phpDocumentor/Reflection/Tag/LinkTest.php
@@ -1,91 +0,0 @@
-<?php
-/**
- * phpDocumentor Link Tag Test
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Ben Selby <benmatselby@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-
-/**
- * Test class for phpDocumentor_Reflection_DocBlock_Tag_Link
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Ben Selby <benmatselby@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-class phpDocumentor_Reflection_DocBlock_Tag_LinkTest extends PHPUnit_Framework_TestCase
-{
- /**
- * Test that the phpDocumentor_Reflection_DocBlock_Tag_Link can create a link
- * for the @link doc block
- *
- * @param string $type
- * @param string $content
- * @param string $exName
- * @param string $exContent
- * @param string $exDescription
- * @param string $exLink
- *
- * @covers phpDocumentor_Reflection_DocBlock_Tag_Link::__construct
- * @dataProvider provideDataForConstuctor
- *
- * @return void
- */
- public function testConstructorParesInputsIntoCorrectFields(
- $type, $content, $exName, $exContent, $exDescription, $exLink
- )
- {
- $tag = new phpDocumentor_Reflection_DocBlock_Tag_Link($type, $content);
-
- $actualName = $tag->getName();
- $actualContent = $tag->getContent();
- $actualDescription = $tag->getDescription();
- $actualLink = $tag->getLink();
-
- $this->assertEquals($exName, $actualName);
- $this->assertEquals($exContent, $actualContent);
- $this->assertEquals($exDescription, $actualDescription);
- $this->assertEquals($exLink, $actualLink);
- }
-
- /**
- * Data provider for testConstructorParesInputsIntoCorrectFields
- *
- * @return array
- */
- public function provideDataForConstuctor()
- {
- // $type, $content, $exName, $exContent, $exDescription, $exLink
- return array(
- array(
- 'link',
- 'http://www.phpdoc.org/',
- 'link',
- 'http://www.phpdoc.org/',
- 'http://www.phpdoc.org/',
- 'http://www.phpdoc.org/'
- ),
- array(
- 'link',
- 'http://www.phpdoc.org/ Testing',
- 'link',
- 'http://www.phpdoc.org/ Testing',
- 'Testing',
- 'http://www.phpdoc.org/'
- ),
- array(
- 'link',
- 'http://www.phpdoc.org/ Testing comments',
- 'link',
- 'http://www.phpdoc.org/ Testing comments',
- 'Testing comments',
- 'http://www.phpdoc.org/'
- ),
- );
- }
-}
View
121 tests/unit/phpDocumentor/Reflection/Tag/MethodTest.php
@@ -1,121 +0,0 @@
-<?php
-/**
- * phpDocumentor Link Tag Test
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Mike van Riel <mike.vanriel@naenius.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-
-/**
- * Test class for phpDocumentor_Reflection_DocBlock_Tag_Link
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Mike van Riel <mike.vanriel@naenius.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-class phpDocumentor_Reflection_DocBlock_Tag_MethodTest extends PHPUnit_Framework_TestCase
-{
- /**
- * @dataProvider getTestSignatures
- *
- * @param string $signature The signature to test
- * @param bool $valid Whether the given signature is expected to
- * be valid.
- * @param string $expected_name The method name that is expected from this
- * signature
- * @param string $expected_return The return type that is expected from this
- * signature
- * @param bool $has_params whether this signature features parameters.
- * @param string $description The short description mentioned in the
- * signature.
- *
- * @return void
- */
- public function testConstruct($signature, $valid, $expected_name,
- $expected_return, $has_params, $description)
- {
- ob_start();
- $tag = new phpDocumentor_Reflection_DocBlock_Tag_Method(
- 'method', $signature
- );
- $stdout = ob_get_clean();
-
- $this->assertSame(
- $valid, empty($stdout),
- 'No error should have been output if the signature is valid'
- );
-
- if (!$valid) return;
-
- $this->assertEquals($expected_name, $tag->getMethodName());
- $this->assertEquals($expected_return, $tag->getType());
- $this->assertEquals($description, $tag->getDescription());
- $this->assertSame(
- $has_params, (bool)(count($tag->getArguments()) > 0),
- 'Number of found arguments should exceed 0'
- );
- }
-
- public function getTestSignatures()
- {
- return array(
- array(
- 'foo',
- false, 'foo', '', false, ''
- ),
- array(
- 'foo()',
- true, 'foo', 'void', false, ''
- ),
- array(
- 'foo() description',
- true, 'foo', 'void', false, 'description'
- ),
- array(
- 'int foo()',
- true, 'foo', 'int', false, ''
- ),
- array(
- 'int foo() description',
- true, 'foo', 'int', false, 'description'
- ),
- array(
- 'int foo($a, $b)',
- true, 'foo', 'int', true, ''
- ),
- array(
- 'int foo() foo(int $a, int $b)',
- true, 'foo', 'int', true, ''
- ),
- array(
- 'int foo(int $a, int $b)',
- true, 'foo', 'int', true, ''
- ),
- array(
- 'null|int foo(int $a, int $b)',
- true, 'foo', 'null|int', true, ''
- ),
- array(
- 'int foo(null|int $a, int $b)',
- true, 'foo', 'int', true, ''
- ),
- array(
- '\Exception foo() foo(Exception $a, Exception $b)',
- true, 'foo', '\Exception', true, ''
- ),
- array(
- 'int foo() foo(Exception $a, Exception $b) description',
- true, 'foo', 'int', true, 'description'
- ),
- array(
- 'int foo() foo(\Exception $a, \Exception $b) description',
- true, 'foo', 'int', true, 'description'
- ),
- );
- }
-}
View
90 tests/unit/phpDocumentor/Reflection/Tag/SeeTest.php
@@ -1,90 +0,0 @@
-<?php
-/**
- * phpDocumentor See Tag Test
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Daniel O'Connor <daniel.oconnor@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-
-/**
- * Test class for phpDocumentor_Reflection_DocBlock_Tag_See
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Daniel O'Connor <daniel.oconnor@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-class phpDocumentor_Reflection_DocBlock_Tag_SeeTest extends PHPUnit_Framework_TestCase
-{
- /**
- * Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link
- * for the @see doc block
- *
- * @param string $type
- * @param string $content
- * @param string $exName
- * @param string $exContent
- * @param string $exReference
- *
- * @covers phpDocumentor_Reflection_DocBlock_Tag_See::__construct
- * @dataProvider provideDataForConstuctor
- *
- * @return void
- */
- public function testConstructorParesInputsIntoCorrectFields(
- $type, $content, $exName, $exContent, $exDescription, $exReference
- )
- {
- $tag = new phpDocumentor_Reflection_DocBlock_Tag_See($type, $content);
-
- $actualName = $tag->getName();
- $actualContent = $tag->getContent();
- $actualDescription = $tag->getDescription();
- $actualReference = $tag->getReference();
-
- $this->assertEquals($exName, $actualName);
- $this->assertEquals($exContent, $actualContent);
- $this->assertEquals($exDescription, $actualDescription);
- $this->assertEquals($exReference, $actualReference);
- }
-
- /**
- * Data provider for testConstructorParesInputsIntoCorrectFields
- *
- * @return array
- */
- public function provideDataForConstuctor()
- {
- // $type, $content, $exName, $exContent, $exDescription, $exReference
- return array(
- array(
- 'uses',
- 'Foo::bar()',
- 'uses',
- 'Foo::bar()',
- '',
- 'Foo::bar()'
- ),
- array(
- 'uses',
- 'Foo::bar() Testing',
- 'uses',
- 'Foo::bar() Testing',
- 'Testing',
- 'Foo::bar()',
- ),
- array(
- 'uses',
- 'Foo::bar() Testing comments',
- 'uses',
- 'Foo::bar() Testing comments',
- 'Testing comments',
- 'Foo::bar()',
- ),
- );
- }
-}
View
90 tests/unit/phpDocumentor/Reflection/Tag/UsesTest.php
@@ -1,90 +0,0 @@
-<?php
-/**
- * phpDocumentor Uses Tag Test
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Daniel O'Connor <daniel.oconnor@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-
-/**
- * Test class for phpDocumentor_Reflection_DocBlock_Tag_Uses
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Daniel O'Connor <daniel.oconnor@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-class phpDocumentor_Reflection_DocBlock_Tag_UsesTest extends PHPUnit_Framework_TestCase
-{
- /**
- * Test that the phpDocumentor_Reflection_DocBlock_Tag_Uses can create a link
- * for the @uses doc block
- *
- * @param string $type
- * @param string $content
- * @param string $exName
- * @param string $exContent
- * @param string $exReference
- *
- * @covers phpDocumentor_Reflection_DocBlock_Tag_Uses::__construct
- * @dataProvider provideDataForConstuctor
- *
- * @return void
- */
- public function testConstructorParesInputsIntoCorrectFields(
- $type, $content, $exName, $exContent, $exDescription, $exReference
- )
- {
- $tag = new phpDocumentor_Reflection_DocBlock_Tag_Uses($type, $content);
-
- $actualName = $tag->getName();
- $actualContent = $tag->getContent();
- $actualDescription = $tag->getDescription();
- $actualReference = $tag->getReference();
-
- $this->assertEquals($exName, $actualName);
- $this->assertEquals($exContent, $actualContent);
- $this->assertEquals($exDescription, $actualDescription);
- $this->assertEquals($exReference, $actualReference);
- }
-
- /**
- * Data provider for testConstructorParesInputsIntoCorrectFields
- *
- * @return array
- */
- public function provideDataForConstuctor()
- {
- // $type, $content, $exName, $exContent, $exDescription, $exReference
- return array(
- array(
- 'uses',
- 'Foo::bar()',
- 'uses',
- 'Foo::bar()',
- '',
- 'Foo::bar()'
- ),
- array(
- 'uses',
- 'Foo::bar() Testing',
- 'uses',
- 'Foo::bar() Testing',
- 'Testing',
- 'Foo::bar()',
- ),
- array(
- 'uses',
- 'Foo::bar() Testing comments',
- 'uses',
- 'Foo::bar() Testing comments',
- 'Testing comments',
- 'Foo::bar()',
- ),
- );
- }
-}
View
81 tests/unit/phpDocumentor/Reflection/Tag/VarTest.php
@@ -1,81 +0,0 @@
-<?php
-/**
- * phpDocumentor Var Tag Test
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Daniel O'Connor <daniel.oconnor@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-
-/**
- * Test class for phpDocumentor_Reflection_DocBlock_Tag_Link
- *
- * @category phpDocumentor
- * @package Reflection
- * @subpackage Tests
- * @author Daniel O'Connor <daniel.oconnor@gmail.com>
- * @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
- */
-class phpDocumentor_Reflection_DocBlock_Tag_VarTest extends PHPUnit_Framework_TestCase
-{
- /**
- * Test that the phpDocumentor_Reflection_DocBlock_Tag_Var can understand
- * the @var doc block
- *
- * @param string $type
- * @param string $content
- * @param string $exType
- * @param string $exVariable
- * @param string $exDescription
- *
- * @covers phpDocumentor_Reflection_DocBlock_Tag_Var::__construct
- * @dataProvider provideDataForConstuctor
- *
- * @return void
- */
- public function testConstructorParesInputsIntoCorrectFields(
- $type, $content, $exType, $exVariable, $exDescription
- )
- {
- $tag = new phpDocumentor_Reflection_DocBlock_Tag_Var($type, $content);
-
- $this->assertEquals($exType, $tag->getType());
- $this->assertEquals($exVariable, $tag->getVariableName());
- $this->assertEquals($exDescription, $tag->getDescription());
- }
-
- /**
- * Data provider for testConstructorParesInputsIntoCorrectFields
- *
- * @return array
- */
- public function provideDataForConstuctor()
- {
- // $type, $content
- return array(
- array(
- 'var',
- 'int',
- 'int',
- '',
- ''
- ),
- array(
- 'var',
- 'int $bob',
- 'int',
- '$bob',
- ''
- ),
- array(
- 'var',
- 'int $bob Number of bobs',
- 'int',
- '$bob',
- 'Number of bobs'
- ),
- );
- }
-}

0 comments on commit 6d93f85

Please sign in to comment.