for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dgame\Expectation;
/**
* Class ScalarExpectations
* @package Dgame\Expectation
*/
class ScalarExpectations
{
use ConditionTrait;
* ScalarExpectations constructor.
*
* @param $value
public function __construct($value)
if ($this->approveIf(is_scalar($value))->isApproved()) {
$this->value = $this->prepare($value);
}
* @return mixed
protected function prepare($value)
return $value;
* @return ScalarExpectations
final public function isEmpty(): self
return $this->approveIf(empty($this->value));
final public function isNotEmpty(): self
return $this->approveIf(!empty($this->value));
final public function isEqual($value): self
return $this->approveIf($this->value == $value);
final public function isNotEqual($value): self
return $this->approveIf($this->value != $value);
final public function isIdenticalTo($value): self
return $this->approveIf($this->value === $value);
final public function isNotIdenticalTo($value): self
return $this->approveIf($this->value !== $value);