Ejemplo n.º 1
0
 /**
  * Finds records in layout logger history
  *
  * @param Mage_PHPUnit_Constraint_Layout_Logger_Interface $other
  * @return array
  */
 protected function findRecords($other)
 {
     if ($this->_arguments !== null) {
         $this->setActualValue($other->findAll(self::ACTION_BLOCK_ACTION, $this->_target));
         return $other->findByParameters(self::ACTION_BLOCK_ACTION, $this->_target, $this->_arguments, $this->_searchType);
     }
     $records = $other->findAll(self::ACTION_BLOCK_ACTION, $this->_target);
     $this->setActualValue($records);
     return $records;
 }
Ejemplo n.º 2
0
 /**
  * Evaluates a property constraint
  *
  * @param Mage_PHPUnit_Constraint_Layout_Logger_Interface $other
  * @return boolean
  */
 protected function evaluateConstraint($other)
 {
     $this->setActualValue($other->getBlockProperty($this->_blockName, $this->_propertyName));
     return $this->_expectedValue->evaluate($this->_actualValue);
 }
Ejemplo n.º 3
0
 /**
  * Evaluates that layout handle was loaded after another
  *
  * @param Mage_PHPUnit_Constraint_Layout_Logger_Interface $other
  * @return boolean
  */
 protected function evaluateLoadedBefore($other)
 {
     $handleInfo = $other->findFirst(self::ACTION_HANDLE_LOADED, $this->_handle);
     if ($handleInfo === false) {
         return false;
     }
     $match = in_array($this->_position, $handleInfo['before']);
     $this->setActualValue($handleInfo['before']);
     array_unshift($this->_actualValue, $this->_handle);
     $this->_expectedValue = $this->_actualValue;
     if (!$match) {
         array_splice($this->_expectedValue, array_search($this->_handle, $this->_expectedValue) + 1, 0, $this->_position);
     }
     return $match;
 }
Ejemplo n.º 4
0
 /**
  * Evaluates that layout block is a child block of expected one
  *
  * @param Mage_PHPUnit_Constraint_Layout_Logger_Interface $other
  * @return boolean
  */
 protected function evaluateParentName($other)
 {
     $this->setActualValue($other->getBlockParent($this->_blockName));
     return $this->_actualValue === $this->_expectedValue;
 }
Ejemplo n.º 5
0
 /**
  * Evaluates that layout was rendered
  *
  *
  * @param Mage_PHPUnit_Constraint_Layout_Logger_Interface $other
  * @return boolean
  */
 protected function evaluateRendered($other)
 {
     return $other->findFirst(self::ACTION_RENDER, 'layout') !== false;
 }