elliotchance / concise

✅ Concise is test framework for using plain English and minimal code, built on PHPUnit.
MIT License
45 stars 3 forks source link

has_item reports incorrectly #109

Closed elliotchance closed 10 years ago

elliotchance commented 10 years ago
    public function getHeaders()
    {
        return ['x-myobapi-cftoken' => $this->cftoken, 'x-myobapi-version' => 0];
    }

This will be successful when it shouldn't:

    public function testMustBeRunningInVersion2()
    {
        $auth = new LocalAuth('user', 'pass');
        $this->assert($auth->getHeaders(), has_item, ["x-myobapi-version" => "v2"]);
    }
elliotchance commented 10 years ago

This is not a bug because PHP considers 0 == "v2" to be true