4 * Copyright © 2003-2024 The Galette Team
6 * This file is part of Galette (https://galette.eu).
8 * Galette is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * Galette is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
22 namespace Galette\Core\test\units
;
24 use PHPUnit\Framework\TestCase
;
29 * @author Johan Cwiklinski <johan@x-tnd.be>
31 class Logo
extends TestCase
33 private \Galette\Core\Db
$zdb;
40 public function setUp(): void
43 $this->zdb
= new \Galette\Core\
Db();
52 public function tearDown(): void
54 if (TYPE_DB
=== 'mysql') {
55 $this->assertSame($this->zdb
->getWarnings(), []);
60 * Test defaults after initialization
64 public function testDefaults()
68 $expected_path = realpath(GALETTE_ROOT
. 'webroot/themes/default/images/galette.png');
70 $instance = new \Galette\Core\
Logo();
71 $this->assertNull($instance->getDestDir());
72 $this->assertNull($instance->getFileName());
73 $this->assertSame($expected_path, $instance->getPath());
74 $this->assertSame('image/png', $instance->getMime());
75 $this->assertSame('png', $instance->getFormat());
76 $this->assertFalse($instance->isCustom());
77 $this->assertSame(129, $instance->getOptimalWidth());
78 $this->assertSame(60, $instance->getOptimalHeight());
79 $this->assertSame(129, $instance->getWidth());
80 $this->assertSame(60, $instance->getHeight());