for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of expect package.
*
* (c) Noritaka Horio <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace expect\matcher;
* Verify the length of the value is 0.
* <code>
* $matcher = new ToBeEmpty();
* $matcher->match(""); //return true
* $matcher->match("fo"); //return false
* $matcher->match([ 1, 2 ]); //return false
* $matcher->match(new ArrayIterator([ 1, 2 ])); //return false
* @author Noritaka Horio <[email protected]>
* @copyright Noritaka Horio <[email protected]>
final class ToBeEmpty implements ReportableMatcher
{
use LengthMatcherDelegatable;
* Create a new matcher.
public function __construct()
$this->lengthMatcher = new ToHaveLength(0);
}