tus = new TusServer; parent::setUp(); } /** * @test * * @covers ::getCache * @covers ::setCache */ public function it_sets_and_gets_cache() : void { $this->assertInstanceOf(FileStore::class, $this->tus->getCache()); $this->tus->setCache('redis'); $this->assertInstanceOf(RedisStore::class, $this->tus->getCache()); $fileStore = new FileStore; $this->assertInstanceOf(TusServer::class, $this->tus->setCache($fileStore)); $this->assertInstanceOf(FileStore::class, $this->tus->getCache()); } /** * @test * * @covers ::getApiPath * @covers ::setApiPath */ public function it_sets_and_gets_api_path() : void { $this->assertEquals('/files', $this->tus->getApiPath()); $this->assertInstanceOf(TusServer::class, $this->tus->setApiPath('/api')); $this->assertEquals('/api', $this->tus->getApiPath()); } /** * @test * * @covers ::event * @covers ::setDispatcher */ public function it_sets_and_gets_event_dispatcher() : void { $this->assertInstanceOf(EventDispatcher::class, $this->tus->event()); $eventDispatcher = new EventDispatcher(); $this->assertInstanceOf(TusServer::class, $this->tus->setDispatcher($eventDispatcher)); $this->assertEquals($eventDispatcher, $this->tus->event()); } }