/** * @param string $username * @param string $password */ public function __construct($username = null, $password = null, Api $api = null) { $this->api = $api ?: new Api(); if ($username && $password) { $this->api->setCredentials(new Basic($username, $password)); } parent::__construct(); }
public function let(Api $client) { $client->setCredentials(Argument::type('Bitbucket\\API\\Authentication\\AuthenticationInterface'))->shouldBeCalled(); $this->beConstructedWith('foo', 'password', $client); }