dbMock = $this->mock(Database::class); Arsse::$db = $this->dbMock->get(); } public function testConstruct(): void { $this->assertTrue(Driver::requirementsMet()); $this->assertInstanceOf(DriverInterface::class, new Driver); } public function testFetchDriverName(): void { $this->assertTrue(strlen(Driver::driverName()) > 0); } public function testEnqueueFeeds(): void { $d = new Driver; $this->assertSame(3, $d->queue(1, 2, 3)); $this->assertSame(5, $d->queue(4, 5)); $this->assertSame(5, $d->clean()); $this->assertSame(1, $d->queue(5)); } public function testRefreshFeeds(): void { $d = new Driver; $d->queue(1, 4, 3); $this->assertSame(Arsse::$conf->serviceQueueWidth, $d->exec()); $this->dbMock->subscriptionUpdate->calledWith(null, 1); $this->dbMock->subscriptionUpdate->calledWith(null, 4); $this->dbMock->subscriptionUpdate->calledWith(null, 3); } }