Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003312 [Quercus] block always 01-30-09 18:45 02-04-09 21:41
Reporter koreth View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.0 Product Version 4.0.0
  Product Build
Summary 0003312: PHPUnit data providers don't work (can't find annotation)
Description http://sebastian-bergmann.de/archives/702-Data-Providers-in-PHPUnit-3.2.html [^] describes PHPUnit's data provider interface.

<?php
include_once 'PHPUnit/Framework.php';
include_once 'PHPUnit/TextUI/ResultPrinter.php';
class MyTest extends PHPUnit_Framework_TestCase {
  public static function provider() {
    return array(array(1,2,4), array(4,5,6));
  }
  /**
   * @dataProvider provider
   */
  public function testAddition($a,$b,$c) {
    $this->assertEquals($c, $a+$b+1);
  }
}
$suite = new PHPUnit_Framework_TestSuite('MyTest');
$result = new PHPUnit_Framework_TestResult;
$printer = new PHPUnit_TextUI_ResultPrinter;
$result->addListener($printer);
$result = $suite->run($result);
$result->flushListeners();
$printer->printResult($result);

Under regular PHP, this runs the test method twice; the first time passes and the second fails. Under Quercus, I get three "Warning: required argument missing" messages and the test is only run once. Apparently the PHPUnit framework is not able to detect the @dataProvider annotation.
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0003805)
nam
02-04-09 21:41

php/5217
php/5218
php/523a
php/523b
php/524j
php/524k
php/5267

PHPUnit annotations should work, though untested.
 

- Issue History
Date Modified Username Field Change
01-30-09 18:45 koreth New Issue
02-03-09 07:19 nam Status new => assigned
02-03-09 07:19 nam Assigned To  => nam
02-04-09 21:41 nam Status assigned => closed
02-04-09 21:41 nam Note Added: 0003805
02-04-09 21:41 nam Resolution open => fixed
02-04-09 21:41 nam Fixed in Version  => 4.0.0


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker