=&{()}"; /** * Data * * @access protected * @var $data */ protected $data; /** * Data Length * * @var $dataLength; * @access protected */ protected $dataLength; public function __construct($data = self::ALPHA_NUMERIC, $dataLength = 62) { $this->setData($data); $this->setDataLength($dataLength); } /** * set data type * * @param $value * @access public */ public function setData($value) { $this->data = $value; } /** * Get data * * @return $data */ public function getData() { return $this->data; } /** * Set data length * * @param $value length of string to return * @access public */ public function setDataLength($value) { $this->dataLength = $value; } /** * Get data length * * @access public * @return $dataLength */ public function getDataLength() { return $this->dataLength; } public function __toString() { return substr($this->getData(), 0, $this->getDataLength()); } } class AssertionTuple { protected $assertionMethod = ''; protected $data; public function __construct($assertionMethod, DataSetValue $data) { $this->setAssertionMethod($assertionMethod); $this->setData($data); } /** * Set assertion method * * @param $assertionMethod * @access public */ public function setAssertionMethod($method) { $this->assertionMethod = 'assert' . ucfirst($method); } /** * Get assertion method * * @access public * @return $assertionMethod */ public function getAssertionMethod() { return $this->assertionMethod; } /** * Set data * * @param $value * @access public */ public function setData($value) { $this->data = $value; } public function getData() { return $this->data; } } class AssertionStack implements Iterator { private $position = 0; protected $stack = array(); public function push(AssertionTuple $tuple) { $this->stack[] = $tuple; } public function rewind() { $this->position = 0; } public function current() { return $this->stack[$this->position]->getData(); } public function key() { return $this->stack[$this->position]->getAssertionMethod(); } public function next() { ++$this->position; } public function valid() { return isset($this->stack[$this->position]); } }