Esempio n. 1
0
 public function endsWith($element)
 {
     $rep = Condition::stringOf($element);
     return $this->is(new Match(function ($value) use($element) {
         return sizeof($value) > 0 && Objects::equal($value[sizeof($value) - 1], $element);
     }, ['%s does not end with ' . $rep, '%s ends with ' . $rep]));
 }
Esempio n. 2
0
 /**
  * Returns whether this optional equals a given value.
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->present === $cmp->present && Objects::equal($this->value, $cmp->value);
 }
Esempio n. 3
0
 /**
  * Check whether a given value is equal to this node list
  *
  * @param  var $cmp The value
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->name === $cmp->name && $this->invert === $cmp->invert && $this->start === $cmp->start && $this->end === $cmp->end && \util\Objects::equal($this->options, $cmp->options) && $this->nodes->equals($cmp->nodes);
 }
 /**
  * Returns whether another object is equal to this
  *
  * @param   lang.Generic $cmp
  * @return  bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->name === $cmp->name && $this->debug === $cmp->debug && $this->arguments === $cmp->arguments && $this->environment === $cmp->environment && $this->scriptlet === null ? null === $cmp->scriptlet : $this->scriptlet->equals($cmp->scriptlet) && Objects::equal($this->logLevels, $cmp->logLevels) && 0 === $this->config->compareTo($cmp->config);
 }
Esempio n. 5
0
 /**
  * Returns whether a given value is equal to this code unit
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && ($this->package === $cmp->package && Objects::equal($this->imports, $cmp->imports) && Objects::equal($this->declaration, $cmp->declaration));
 }
Esempio n. 6
0
 /**
  * Returns whether a given value is equal to this mime part
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->contenttype === $cmp->contenttype && $this->charset === $cmp->charset && $this->encoding === $cmp->encoding && $this->disposition === $cmp->disposition && $this->name === $cmp->name && $this->filename === $cmp->filename && $this->id === $cmp->id && $this->body === $cmp->body && Objects::equal($this->headers, $cmp->headers);
 }
Esempio n. 7
0
 /**
  * Returns whether a given value is equal to this code unit
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && (Objects::equal($this->parameters, $cmp->parameters) && $this->return->equals($cmp->return));
 }
Esempio n. 8
0
 public function differently_ordered_hashes_are_equal()
 {
     $this->assertTrue(Objects::equal(['price' => 12.99, 'color' => 'blue'], ['color' => 'blue', 'price' => 12.99]));
 }
Esempio n. 9
0
 /**
  * Returns whether a given value is equal to this code unit
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && ($this->base->equals($cmp->base) && Objects::equal($this->arguments, $cmp->arguments));
 }
Esempio n. 10
0
 /**
  * Indicates whether the argument on postion $pos machtes the specified
  * value.
  *
  * @param   int pos
  * @param   var value
  * @return  bool
  */
 private function doesMatchArg($pos, $value)
 {
     $argVal = $this->args[$pos];
     if ($argVal instanceof \unittest\mock\arguments\IArgumentMatcher) {
         return $argVal->matches($value);
     } else {
         return Objects::equal($argVal, $value);
     }
 }
Esempio n. 11
0
 /**
  * Check whether a given value is equal to this node list
  *
  * @param  var $cmp The value
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->source === $cmp->source && \util\Objects::equal($this->root, $cmp->root);
 }
Esempio n. 12
0
 /**
  * Returns whether a given value is equal to this Response instance
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->status === $cmp->status && Objects::equal($this->headers, $cmp->headers) && Objects::equal($this->cookies, $cmp->cookies);
 }
Esempio n. 13
0
 /**
  * Returns whether a given value is equal to this Response instance
  *
  * @param  var cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return parent::equals($cmp) && $this->mediaType === $cmp->mediaType && $this->contentLength === $cmp->contentLength && Objects::equal($this->inputStream, $cmp->inputStream);
 }
Esempio n. 14
0
 /**
  * Test whether a given value is equal to this location instance.
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && (abs($this->lat - $cmp->lat) < 1.0E-5 && abs($this->long - $cmp->long) < 1.0E-5 && Objects::equal($this->attr, $cmp->attr));
 }
Esempio n. 15
0
 /**
  * Check if is equal to other object
  *
  * @param   var $cmp
  * @return  bool
  */
 public function equals($cmp)
 {
     if (!$cmp instanceof self) {
         return false;
     }
     // If based on files, and both base on the same file, then they're equal
     if (null === $this->_data && null === $cmp->_data) {
         return $this->_file === $cmp->_file;
     } else {
         return Objects::equal($this->_data, $cmp->_data);
     }
 }
Esempio n. 16
0
 /**
  * Returns whether a given value is equal to this annotation
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && ($this->name === $cmp->name && Objects::equal($this->value, $cmp->value));
 }
Esempio n. 17
0
 /**
  * Returns whether a given value is equal to this results instance
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->path->equals($cmp->path) && Objects::equal($this->value, $cmp->value);
 }
Esempio n. 18
0
 /**
  * Returns whether a given value is equal to this payload
  * 
  * @param  var cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && Objects::equal($cmp->value, $this->value) && $this->properties === $cmp->properties;
 }
Esempio n. 19
0
 /**
  * Check whether a given value is equal to this node list
  *
  * @param  var $cmp The value
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->name === $cmp->name && $this->escape === $cmp->escape && \util\Objects::equal($this->options, $cmp->options);
 }
Esempio n. 20
0
 /**
  * Returns whether a given comparison value is equal to this LDAP entry
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->dn === $cmp->dn && Objects::equal($this->attributes, $cmp->attributes);
 }
Esempio n. 21
0
 /**
  * Returns whether a given value is equal to this pair
  *
  * @param  var cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && Objects::equal($cmp->key, $this->key);
 }
Esempio n. 22
0
 /**
  * Returns whether a given value is equal to this code unit
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && Objects::equal($this->backing, $cmp->backing);
 }
Esempio n. 23
0
 /**
  * Returns true if a given value matches this `IsEqualToArray` condition.
  *
  * @param  var $value
  * @return bool
  */
 public function matches($value)
 {
     return Objects::equal($this->value, $value);
 }
Esempio n. 24
0
 /**
  * Checks whether an object is equal to this DSN
  *
  * @param   lang.Generic cmp
  * @return  bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $cmp->getDriver() === $this->getDriver() && $cmp->getUser() === $this->getUser() && $cmp->getPassword() === $this->getPassword() && $cmp->getHost() === $this->getHost() && $cmp->getPort() === $this->getPort() && $cmp->getDatabase() === $this->getDatabase() && $cmp->flags === $this->flags && Objects::equal($cmp->prop, $this->prop);
 }
Esempio n. 25
0
 /**
  * Returns whether a given comparison value is equal to this node list
  *
  * @param  var $cmp
  * @return string
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && $this->url === $cmp->url && $this->title === $cmp->title && Objects::equal($this->text, $cmp->text);
 }
Esempio n. 26
0
 /**
  * Assert that two values are not equal
  *
  * @param   var expected
  * @param   var actual
  * @param   string error default 'equal'
  * @return  void
  */
 public function assertNotEquals($expected, $actual, $error = '!equals')
 {
     if (Objects::equal($expected, $actual)) {
         $this->fail($error, $actual, $expected);
     }
 }
Esempio n. 27
0
 /**
  * Returns whether a given value is equal to this list
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && Objects::equal($this->indexed, $cmp->indexed);
 }
Esempio n. 28
0
 /**
  * Check for equality
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && Objects::equal($cmp->failures, $this->failures);
 }
Esempio n. 29
0
 /**
  * Returns whether another instance is equal to this
  *
  * @param  var $cmp
  * @return bool
  */
 public function equals($cmp)
 {
     return $cmp instanceof self && Objects::equal($this->links, $cmp->links);
 }
Esempio n. 30
0
 /**
  * Returns whether a given comparison value is equal to this parse tree
  *
  * @param  var $cmp
  * @return string
  */
 public function equals($cmp)
 {
     return parent::equals($cmp) && Objects::equal($this->urls, $cmp->urls);
 }