protected function buildLogStrategy()
 {
     $this->logger = new LoggerSpy();
     $logStrategy = new LogProxyStrategy();
     $logStrategy->setLogger($this->logger);
     $this->proxyStrategyBagFactory->setLogStrategy($logStrategy);
     $this->proxyStrategyRequestFactory->setLogProxyStrategyRequestBuilder(new LogProxyStrategyRequestBuilderImpl());
 }
示例#2
0
 /**
  * @return ProxyStrategyBagFactoryImpl
  */
 protected function buildProxyStrategyBagFactory()
 {
     $proxyStrategyBagFactory = new ProxyStrategyBagFactoryImpl();
     if (null !== $this->cache) {
         $proxyStrategyBagFactory->setCacheStrategy($this->buildCacheStrategy());
     }
     if (null !== $this->event) {
         $proxyStrategyBagFactory->setEventStrategy($this->buildEventStrategy());
     }
     if (null !== $this->logger) {
         $proxyStrategyBagFactory->setLogStrategy($this->buildLogStrategy());
     }
     if (null !== $this->security) {
         $proxyStrategyBagFactory->setSecurityStrategy($this->buildSecurityStrategy());
     }
     if (null !== $this->transaction) {
         $proxyStrategyBagFactory->setTransactionStrategy($this->buildTransactionStrategy());
     }
     return $proxyStrategyBagFactory;
 }
 /**
  * @test
  * @expectedException \OpenClassrooms\UseCase\Application\Services\Proxy\Strategies\Exceptions\UnSupportedAnnotationException
  */
 public function UnsupportedAnnotation_Make_ThrowException()
 {
     $factory = new ProxyStrategyBagFactoryImpl();
     $factory->make('unsupported annotation');
 }