url = $this->createMock(IURLGenerator::class); $this->adminSection = new AdminSection($this->url); } /** * Requests the correct app icon path from the URL generator and returns a non-empty string. */ public function testGetIcon(): void { $this->url->expects($this->once()) ->method("imagePath") ->with("onlyoffice", "app-dark.svg") ->willReturn("apps/onlyoffice/img/app-dark.svg"); $this->assertNotEmpty($this->adminSection->getIcon()); } /** * Returns the onlyoffice section identifier. */ public function testGetID(): void { $this->assertSame("onlyoffice", $this->adminSection->getID()); } /** * Returns the human-readable section name. */ public function testGetName(): void { $this->assertSame("ONLYOFFICE", $this->adminSection->getName()); } /** * Returns a positive integer as the section priority. */ public function testGetPriority(): void { $this->assertGreaterThan(0, $this->adminSection->getPriority()); } }