Skip to content

Commit

Permalink
- Merge [3338].
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jul 2, 2008
1 parent fa0c5cf commit c8c8546
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
9 changes: 5 additions & 4 deletions PHPUnit/Framework/TestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,11 @@ public function __construct($theClass = '', $name = '')
throw new InvalidArgumentException;
}

PHPUnit_Util_Filter::addFileToFilter(
realpath($theClass->getFilename()),
'TESTS'
);
$filename = $theClass->getFilename();

if (strpos($filename, 'eval()') === FALSE) {
PHPUnit_Util_Filter::addFileToFilter(realpath($filename), 'TESTS');
}

if ($name != '') {
$this->setName($name);
Expand Down
19 changes: 19 additions & 0 deletions PHPUnit/Tests/TextUI/skeleton.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
phpunit Calculator ../_files/Calculator.php
--FILE--
<?php
$_SERVER['argv'][1] = 'Calculator';
$_SERVER['argv'][2] = dirname(dirname(__FILE__)) . '/_files/Calculator.php';

require_once dirname(dirname(dirname(__FILE__))) . '/TextUI/Command.php';

PHPUnit_TextUI_Command::main();
?>
--EXPECT--
PHPUnit @package_version@ by Sebastian Bergmann.

....

Time: 0 seconds

OK (4 tests, 4 assertions)
15 changes: 15 additions & 0 deletions PHPUnit/Tests/_files/Calculator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
class Calculator
{
/**
* @assert (0, 0) == 0
* @assert (0, 1) == 1
* @assert (1, 0) == 1
* @assert (1, 1) == 2
*/
public function add($a, $b)
{
return $a + $b;
}
}
?>
4 changes: 4 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@
<file baseinstalldir="/" name="log-tap.phpt" role="test" />
<file baseinstalldir="/" name="log-xml.phpt" role="test" />
<file baseinstalldir="/" name="repeat.phpt" role="test" />
<file baseinstalldir="/" name="skeleton.phpt" role="test" />
<file baseinstalldir="/" name="tap.phpt" role="test" />
<file baseinstalldir="/" name="testdox-html.phpt" role="test" />
<file baseinstalldir="/" name="testdox.phpt" role="test" />
Expand Down Expand Up @@ -818,6 +819,9 @@
<file baseinstalldir="/" name="AnInterface.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="Calculator.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" name="ClassWithNonPublicAttributes.php" role="test">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
Expand Down

0 comments on commit c8c8546

Please sign in to comment.