/**
  * @return void
  */
 protected function setUp()
 {
     $store = new Store();
     $factory = new Factory();
     $this->codecMatcher = $factory->createCodecMatcher();
     $this->interpreter = $this->getMockForAbstractClass(AbstractRequestInterpreter::class);
     $this->adapter = $this->getMock(AdapterInterface::class);
     $this->adapter->method('recognises')->with('posts')->willReturn(true);
     $store->register($this->adapter);
     $this->api = new Api('v1', $this->interpreter, $this->codecMatcher, $factory->createContainer(), $store);
     $this->requestFactory = new RequestFactory();
     $this->withMediaType();
 }
Exemplo n.º 2
0
 /**
  * @param array $adapters
  * @return Store
  */
 private function store(array $adapters)
 {
     $store = new Store();
     $store->registerMany($adapters);
     return $store;
 }