/** * @test * * @covers Pipedrive\Services\CacheProvider::register */ public function shouldRegisterAppCache() { $this->serviceProvider->method('register')->willReturnCallback(function (Application $app) { $app['app.cache'] = $this->getMock(ArrayCache::class, [], [], '', false); }); $app = new Application(); $app->register($this->serviceProvider); $this->assertInstanceOf(ArrayCache::class, $app['app.cache']); }
/** * @test * * @covers Pipedrive\Services\ValidatorProvider::register */ public function shouldRegisterValidator() { $this->serviceProvider->method('register')->willReturnCallback(function (Application $app) { $app['validator.builder'] = $this->getMock(ValidatorInterface::class, [], [], '', false); }); $app = new Application(); $app->register($this->serviceProvider); $this->assertInstanceOf(ValidatorInterface::class, $app['validator.builder']); }
/** * @test * * @covers Pipedrive\Services\DbProvider::register */ public function shouldRegisterConfiguration() { $this->serviceProvider->method('register')->willReturnCallback(function (Application $app) { $app['annotation.reader.internal'] = $this->getMock(Configuration::class, [], [], '', false); }); $app = new Application(); $app->register($this->serviceProvider); $this->assertInstanceOf(Configuration::class, $app['annotation.reader.internal']); }
/** * @test * * @covers Pipedrive\Services\BrokerProvider::register */ public function shouldRegisterBrokerClientProvider() { $this->serviceProvider->method('register')->willReturnCallback(function (Application $app) { $app['broker'] = $this->getMock(Broker::class, [], [], '', false); }); $app = new Application(); $app->register($this->serviceProvider); $this->assertInstanceOf(Broker::class, $app['broker']); }
/** * @test * * @covers Pipedrive\Services\EventDispatcherProvider::register */ public function shouldRegisterNetworkProvider() { $this->serviceProvider->method('register')->willReturnCallback(function (Application $app) { $app['event.dispatcher'] = $this->getMock(EventDispatcher::class, [], [], '', false); }); $app = new Application(); $app->register($this->serviceProvider); $this->assertInstanceOf(EventDispatcher::class, $app['event.dispatcher']); }
/** * @test * * @covers Pipedrive\Services\HttpProvider::register */ public function shouldRegisterNetworkProvider() { $this->serviceProvider->method('register')->willReturnCallback(function (Application $app) { $app['api.pipedrive.client'] = $this->getMock(Client::class, [], [], '', false); }); $app = new Application(); $app->register($this->serviceProvider); $this->assertInstanceOf(Client::class, $app['api.pipedrive.client']); }