public function verifyInvoked($name, $params = null)
    {
        $calls = $this->getCallsForMethod($name);
        $separator = $this->callSyntax($name);

        if (empty($calls)) throw new fail(sprintf($this->invokedFail, $this->className.$separator.$name, ''));

        if (is_array($params)) {
            foreach ($calls as $args) {
                if ($this->onlyExpectedArguments($params, $args) === $params) return;
            }
            $params    = ArgumentsFormatter::toString($params);
            $gotParams = ArgumentsFormatter::toString($calls[0]);

            throw new fail(sprintf($this->invokedFail, $this->className.$separator.$name."($params)", $this->className.$separator.$name."($gotParams)"));
        } else if(is_callable($params)) {
            $params($calls);
        }
    }
public function verifyInvoked($name, $params = null)
    {
        $calls = $this->getCallsForMethod($name);
        $separator = $this->callSyntax($name);

        if (empty($calls)) throw new fail(sprintf($this->invokedFail, $this->className.$separator.$name, ''));

        if (is_array($params)) {
            foreach ($calls as $args) {
                if ($this->onlyExpectedArguments($params, $args) === $params) return;
            }
            $params    = ArgumentsFormatter::toString($params);
            $gotParams = ArgumentsFormatter::toString($calls[0]);

            throw new fail(sprintf($this->invokedFail, $this->className.$separator.$name."($params)", $this->className.$separator.$name."($gotParams)"));
        } else if(is_callable($params)) {
            $params($calls);
        }
    }
public function verifyInvoked ( $ name , $ params = null ) { $ calls = $ this -> getCallsForMethod ( $ name ) ; $ separator = $ this -> callSyntax ( $ name ) ; if ( empty ( $ calls ) ) throw new fail ( sprintf ( $ this -> invokedFail , $ this -> className . $ separator . $ name , '' ) ) ; if ( is_array ( $ params ) ) { foreach ( $ calls as $ args ) { if ( $ this -> onlyExpectedArguments ( $ params , $ args ) === $ params ) return ; } $ params = ArgumentsFormatter :: toString ( $ params ) ; $ gotParams = ArgumentsFormatter :: toString ( $ calls [ 0 ] ) ; throw new fail ( sprintf ( $ this -> invokedFail , $ this -> className . $ separator . $ name . "($params)" , $ this -> className . $ separator . $ name . "($gotParams)" ) ) ; } else if ( is_callable ( $ params ) ) { $ params ( $ calls ) ; } }
Verifies a method was invoked at least once.
In second argument you can specify with which params method expected to be invoked;

``` php
<?php
$user->verifyInvoked('save');
$user->verifyInvoked('setName',['davert']);

?>
```

@param $name
@param null $params
@throws \PHPUnit\Framework\ExpectationFailedException
@param array $params
@throws fail
Verifies a method was invoked at least once . In second argument you can specify with which params method expected to be invoked ;