*/ protected array $fixtures = ['app.Polls', 'app.Slides', 'app.SlideOptions', 'app.Responses']; public function testAllLayoutsLinkTheIcons(): void { [$poll, $token] = $this->createPoll(); $this->createSlide($poll); // default, present and error layout foreach (['/', '/admin/' . $token . '/present', '/does-not-exist'] as $url) { $this->get($url); // Root-relative, no "img/" prefix (static files live directly in webroot/). $this->assertResponseRegExp('##', $url); $this->assertResponseRegExp('##', $url); $this->assertResponseRegExp('##', $url); } } public function testIconFilesAreValid(): void { $svg = (string)file_get_contents(WWW_ROOT . 'favicon.svg'); $this->assertStringContainsString('assertNotFalse(simplexml_load_string($svg), 'favicon.svg is not well-formed XML'); // ICO: reserved 0, type 1, three images; each entry's data starts with the PNG signature. $ico = (string)file_get_contents(WWW_ROOT . 'favicon.ico'); $header = unpack('vreserved/vtype/vcount', $ico); $this->assertSame([0, 1, 3], [$header['reserved'], $header['type'], $header['count']]); for ($i = 0; $i < $header['count']; $i++) { $entry = unpack('Voffset', $ico, 6 + 16 * $i + 12); $this->assertSame("\x89PNG", substr($ico, $entry['offset'], 4)); } $this->assertSame([180, 180], array_slice(getimagesize(WWW_ROOT . 'apple-touch-icon.png'), 0, 2)); } }