Gets provider object by name. If there is no such provider
in providers array, it will try to create it, then save
it, and then return.
public getProvider ( string $provider ) : |
||
$provider | string | |
return |
/** * @test * @expectedException \seregazhuk\PinterestBot\Exceptions\WrongProviderException */ public function getWrongProvider() { $this->container->getProvider('unknown'); }
/** * Magic method to access different providers from the providers container. * * @param string $provider * @return Provider */ public function __get($provider) { return $this->providersContainer->getProvider($provider); }
/** * @test * @expectedException \seregazhuk\PinterestBot\Exceptions\WrongProvider */ public function it_should_throw_exception_on_getting_wrong_provider() { $this->container->getProvider('unknown'); }