Qual: More PHPUnit tests
This commit is contained in:
parent
f70b1894db
commit
b2d635dab7
@ -2912,5 +2912,30 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise an instance with random values.
|
||||||
|
* Used to build previews or test instances.
|
||||||
|
* id must be 0 if object instance is a specimen.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function initAsSpecimen()
|
||||||
|
{
|
||||||
|
global $user,$langs,$conf,$mysoc;
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
|
// Initialize parameters
|
||||||
|
$this->id=0;
|
||||||
|
$this->ref = 'PRODUCT_SPEC';
|
||||||
|
$this->libelle = 'PRODUCT SPECIMEN';
|
||||||
|
$this->description = 'PRODUCT SPECIMEN '.dol_print_date($now,'dayhourlog');
|
||||||
|
$this->specimen=1;
|
||||||
|
$this->country_id=1;
|
||||||
|
$this->tosell=1;
|
||||||
|
$this->tobuy=1;
|
||||||
|
$this->type=0;
|
||||||
|
$this->note='This is a comment (private)';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -75,6 +75,9 @@ class AllTests
|
|||||||
require_once dirname(__FILE__).'/DiscountTest.php';
|
require_once dirname(__FILE__).'/DiscountTest.php';
|
||||||
$suite->addTestSuite('DiscountTest');
|
$suite->addTestSuite('DiscountTest');
|
||||||
|
|
||||||
|
require_once dirname(__FILE__).'/ProductTest.php';
|
||||||
|
$suite->addTestSuite('ProductTest');
|
||||||
|
|
||||||
require_once dirname(__FILE__).'/CommandeTest.php';
|
require_once dirname(__FILE__).'/CommandeTest.php';
|
||||||
$suite->addTestSuite('CommandeTest');
|
$suite->addTestSuite('CommandeTest');
|
||||||
require_once dirname(__FILE__).'/CommandeFournisseurTest.php';
|
require_once dirname(__FILE__).'/CommandeFournisseurTest.php';
|
||||||
|
|||||||
@ -145,10 +145,6 @@ class ProductTest extends PHPUnit_Framework_TestCase
|
|||||||
print __METHOD__." id=".$id." result=".$result."\n";
|
print __METHOD__." id=".$id." result=".$result."\n";
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
|
|
||||||
$result=$localobject->verify();
|
|
||||||
print __METHOD__." id=".$id." result=".$result."\n";
|
|
||||||
$this->assertEquals($result, 0);
|
|
||||||
|
|
||||||
return $localobject;
|
return $localobject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user