/** * 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; }
/** * 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; }
/** * 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; }
/** * 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); }
/** * 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; }