Note that there are some explanatory texts on larger screens.

plurals
  1. POPHPUnit fails in Netbeans with Namespaces
    primarykey
    data
    text
    <p>I have: PHP 5.3.8, PHPUnit 3.5.15, Netbeans 7.0.1</p> <p>While using the standard example of Netbeans for PHPUnit testing, it runs perfectly. By adding just the "namespace test;" I get the error that Calculator.php is not a file nor a directory. How to solve this problem? (I would like to use the namespace declarative in my project)</p> <p>THE CLASS TO TEST: <pre><code>namespace test; class Calculator { /** * @assert (0, 0) == 0 * @assert (0, 1) == 1 * @assert (1, 0) == 1 * @assert (1, 1) == 2 * @assert (1, 2) == 4 */ public function add($a, $b) { return $a + $b; } } ?&gt; </code></pre> <p>THE UNIT TEST: <pre><code>require_once dirname(__FILE__) . '/../Calculator.php'; /** * Test class for Calculator. * Generated by PHPUnit on 2011-09-11 at 00:52:24. */ class CalculatorTest extends PHPUnit_Framework_TestCase { /** * @var Calculator */ protected $object; /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this-&gt;object = new Calculator; } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { } /** * Generated from @assert (0, 0) == 0. */ public function testAdd() { $this-&gt;assertEquals( 0, $this-&gt;object-&gt;add(0, 0) ); } /** * Generated from @assert (0, 1) == 1. */ public function testAdd2() { $this-&gt;assertEquals( 1, $this-&gt;object-&gt;add(0, 1) ); } /** * Generated from @assert (1, 0) == 1. */ public function testAdd3() { $this-&gt;assertEquals( 1, $this-&gt;object-&gt;add(1, 0) ); } /** * Generated from @assert (1, 1) == 2. */ public function testAdd4() { $this-&gt;assertEquals( 2, $this-&gt;object-&gt;add(1, 1) ); } /** * Generated from @assert (1, 2) == 4. */ public function testAdd5() { $this-&gt;assertEquals( 4, $this-&gt;object-&gt;add(1, 2) ); } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload