/**
  * For layout, actual value should be always set
  * (non-PHPdoc)
  * @see EcomDev_PHPUnit_ConstraintAbstract::getActualValue()
  */
 protected function getActualValue($other = null)
 {
     if ($this->_useActualValue) {
         return parent::getActualValue($other);
     }
     return '';
 }
Example #2
0
 /**
  * Constraint for checking JSON values
  *
  *
  * @param string $type
  * @param array $expectedValue expected json in array format
  * @param string $matchType
  */
 public function __construct($type, $expectedValue = null, $matchType = self::MATCH_AND)
 {
     if ($expectedValue !== null && (empty($matchType) || !is_string($matchType))) {
         PHPUnit_Util_InvalidArgumentHelper::factory(3, 'string', $matchType);
     }
     $this->_expectedValueValidation += array(self::TYPE_MATCH => array(true, 'is_array', 'array'));
     $this->_typesWithDiff[] = self::TYPE_MATCH;
     parent::__construct($type, $expectedValue);
     $this->_matchType = $matchType;
 }
Example #3
0
 /**
  * Constraint for controller request assetions
  *
  *
  * @param string $type
  * @param string|null $expectedValue
  */
 public function __construct($type, $expectedValue = null)
 {
     $this->_expectedValueValidation += array(self::TYPE_ROUTE => array(true, 'is_string', 'string'), self::TYPE_ROUTE_NAME => array(true, 'is_string', 'string'), self::TYPE_CONTROLLER_NAME => array(true, 'is_string', 'string'), self::TYPE_CONTROLLER_MODULE => array(true, 'is_string', 'string'), self::TYPE_ACTION_NAME => array(true, 'is_string', 'string'), self::TYPE_BEFORE_FORWARD_ROUTE => array(true, 'is_string', 'string'));
     $this->_typesWithDiff[] = self::TYPE_ROUTE;
     $this->_typesWithDiff[] = self::TYPE_ROUTE_NAME;
     $this->_typesWithDiff[] = self::TYPE_CONTROLLER_NAME;
     $this->_typesWithDiff[] = self::TYPE_CONTROLLER_MODULE;
     $this->_typesWithDiff[] = self::TYPE_ACTION_NAME;
     $this->_typesWithDiff[] = self::TYPE_BEFORE_FORWARD_ROUTE;
     parent::__construct($type, $expectedValue);
 }
 /**
  * Exporter instance for variables
  * 
  * @return \SebastianBergmann\Exporter\Exporter
  */
 public static function getExporter()
 {
     if (self::$_exporter === null) {
         self::$_exporter = new \SebastianBergmann\Exporter\Exporter();
     }
     return self::$_exporter;
 }
 /**
  * Returns a scalar representation of expected value
  *
  * @return string
  */
 protected function getExpectedValue()
 {
     if ($this->_expectedValue instanceof Varien_Simplexml_Element) {
         return $this->getXmlAsDom($this->_expectedValue);
     }
     return parent::getExpectedValue();
 }