mageekguy\atoum\asserters\variable::setWith PHP Method

setWith() public method

public setWith ( $value )
    public function setWith($value)
    {
        parent::setWith($value);
        $this->value = $value;
        $this->isSet = true;
        $this->isSetByReference = false;
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 protected function matches($actual)
 {
     if ($this->delta == null && $this->analyzer->isFloat($actual) === false && $this->analyzer->isFloat($this->expected) === false) {
         $asserter = new asserters\variable(null, $this->analyzer);
         if ($this->analyzer->isString($actual) && $this->ignoreCase) {
             $actual = strtolower($actual);
         }
         if ($this->analyzer->isArray($actual) && $this->canonicalize) {
             $actual = sort($actual);
         }
         $asserter->setWith($actual);
         if ($actual === 0 && $this->expected == '' || $actual == '' && $this->expected === 0) {
             $asserter->isIdenticalTo($this->expected);
         } else {
             $expected = $this->expected;
             if ($this->analyzer->isString($expected) && $this->ignoreCase) {
                 $expected = strtolower($expected);
             }
             if ($this->analyzer->isArray($expected) && $this->canonicalize) {
                 $expected = sort($expected);
             }
             $asserter->isEqualTo($expected);
         }
     } else {
         $asserter = new asserters\phpFloat(null, $this->analyzer);
         $asserter->setWith((double) $actual)->isNearlyEqualTo((double) $this->expected, $this->delta);
     }
 }
All Usage Examples Of mageekguy\atoum\asserters\variable::setWith