/**
  * testFactureFournisseurValid
  *
  * @param	Object	$localobject	Supplier invoice
  * @return	void
  *
  * @depends	testFactureFournisseurUpdate
  * The depends says test is run only if previous is ok
  */
 public function testFactureFournisseurValid($localobject)
 {
     global $conf, $user, $langs, $db;
     $conf = $this->savconf;
     $user = $this->savuser;
     $langs = $this->savlangs;
     $db = $this->savdb;
     $result = $localobject->validate($user);
     print __METHOD__ . " id=" . $localobject->id . " result=" . $result . "\n";
     $this->assertLessThan($result, 0);
     return $localobject;
 }
Example #2
0
    /**
     * testFactureValid
     *
     * @param	Object	$localobject	Invoice
     * @return	void
     *
     * @depends	testFactureUpdate
     * The depends says test is run only if previous is ok
     */
    public function testFactureValid($localobject)
    {
    	global $conf,$user,$langs,$db;
		$conf=$this->savconf;
		$user=$this->savuser;
		$langs=$this->savlangs;
		$db=$this->savdb;

    	$result=$localobject->validate($user);
    	print __METHOD__." id=".$localobject->id." result=".$result."\n";

    	$this->assertLessThan($result, 0);

    	// Test everything are still same than specimen
    	$newlocalobject=new Facture($this->savdb);
    	$newlocalobject->initAsSpecimen();
    	$this->changeProperties($newlocalobject);
        $this->assertEquals($this->objCompare($localobject,$newlocalobject,true,array('id','lines','client','thirdparty','brouillon','user_author','date_creation','date_validation','datem','ref','statut','paye','specimen','facnumber','actiontypecode','actionmsg2','actionmsg','mode_reglement','cond_reglement','cond_reglement_doc')), array());    // Actual, Expected

    	return $localobject;
    }
Example #3
0
 /**
  * @dataProvider provideTestFilter
  */
 public function testFilter($options, $raw, $filtered, $valid)
 {
     $int = new Object($options);
     $this->assertEquals($filtered, $int->filter($raw));
     $this->assertEquals($valid, $int->validate($raw));
 }
Example #4
0
 /**
  * 通过定制的验证器验证
  * 
  * @param string $data 数据
  * @param Object $specify 验证器对象
  * @return bool 是否合法
  */
 function _validateBySpecify($data, $specify)
 {
     return $specify->validate($data);
 }
 /**
  * Test that an exception is thrown when you pass an invalid rule
  *
  * @return void
  * @author Dan Cox
  */
 public function test_exceptionOnInvalidRequirement()
 {
     $this->setExpectedException('Danzabar\\CLI\\Input\\Exceptions\\IncorrectValidationMethodException');
     $this->inputArgument->addExpected('name', 'fakerule');
     $this->inputArgument->validate('name', '');
 }