コード例 #1
0
 /**
  * Evaluates that layout was rendered
  *
  *
  * @param EcomDev_PHPUnit_Constraint_Layout_LoggerInterface $other
  * @return boolean
  */
 protected function evaluateRendered($other)
 {
     return $other->findFirst(self::ACTION_RENDER, 'layout') !== false;
 }
コード例 #2
0
ファイル: Block.php プロジェクト: cmuench/EcomDev_PHPUnit
 /**
  * Evaluates that layout block is a child block of expected one
  *
  * @param EcomDev_PHPUnit_Constraint_Layout_LoggerInterface $other
  * @return boolean
  */
 protected function evaluateParentName($other)
 {
     $this->setActualValue($other->getBlockParent($this->_blockName));
     return $this->_actualValue === $this->_expectedValue;
 }
コード例 #3
0
 /**
  * Finds records in layout logger history
  *
  * @param EcomDev_PHPUnit_Constraint_Layout_LoggerInterface $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;
 }
コード例 #4
0
ファイル: Property.php プロジェクト: cmuench/EcomDev_PHPUnit
 /**
  * Evaluates a property constraint
  *
  * @param EcomDev_PHPUnit_Constraint_Layout_LoggerInterface $other
  * @return boolean
  */
 protected function evaluateConstraint($other)
 {
     $this->setActualValue($other->getBlockProperty($this->_blockName, $this->_propertyName));
     return $this->_expectedValue->evaluate($this->_actualValue);
 }
コード例 #5
0
 /**
  * Evaluates that layout handle was loaded after another
  *
  * @param EcomDev_PHPUnit_Constraint_Layout_LoggerInterface $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;
 }