EasyWeChat\Foundation\Application::addProvider PHP Method

addProvider() public method

Add a provider.
public addProvider ( string $provider ) : Application
$provider string
return Application
    public function addProvider($provider)
    {
        array_push($this->providers, $provider);
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Test addProvider() and setProviders.
  */
 public function testProviders()
 {
     $app = new Application(['foo' => 'bar']);
     $providers = $app->getProviders();
     $app->addProvider(Mockery::mock(ServiceProviderInterface::class));
     $this->assertCount(count($providers) + 1, $app->getProviders());
     $app->setProviders(['foo', 'bar']);
     $this->assertSame(['foo', 'bar'], $app->getProviders());
 }