]> git.agnieray.net Git - galette.git/blob - tests/Galette/Core/tests/units/PrintLogo.php
5e93aebd9096ecf9a31ff2a3a6a1b8d33621fe52
[galette.git] / tests / Galette / Core / tests / units / PrintLogo.php
1 <?php
2
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5 /**
6 * Print logo tests
7 *
8 * PHP version 5
9 *
10 * Copyright © 2017 The Galette Team
11 *
12 * This file is part of Galette (http://galette.tuxfamily.org).
13 *
14 * Galette is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * Galette is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
26 *
27 * @category IO
28 * @package GaletteTests
29 *
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2017 The Galette Team
32 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
33 * @version SVN: $Id$
34 * @link http://galette.tuxfamily.org
35 * @since 2017-07-08
36 */
37
38 namespace Galette\Core\test\units;
39
40 use atoum;
41
42 /**
43 * Picture tests class
44 *
45 * @category Core
46 * @name PrintLogo
47 * @package GaletteTests
48 * @author Johan Cwiklinski <johan@x-tnd.be>
49 * @copyright 2017 The Galette Team
50 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
51 * @link http://galette.tuxfamily.org
52 * @since 2017-07-08
53 */
54 class PrintLogo extends atoum
55 {
56 private $zdb;
57
58 /**
59 * Set up tests
60 *
61 * @param string $testMethod Method name
62 *
63 * @return void
64 */
65 public function beforeTestMethod($testMethod)
66 {
67 global $zdb;
68 $this->zdb = new \Galette\Core\Db();
69 $zdb = $this->zdb;
70 }
71
72 /**
73 * Test defaults after initialization
74 *
75 * @return void
76 */
77 public function testDefaults()
78 {
79 global $zdb;
80 $zdb = $this->zdb;
81 $logo = new \Galette\Core\PrintLogo();
82 $this->variable($logo->getDestDir())->isNull();
83 $this->variable($logo->getFileName())->isNull();
84
85 $expected_path = realpath(GALETTE_ROOT . 'webroot/themes/default/images/galette.png');
86 $this->string($logo->getPath())->isIdenticalTo($expected_path);
87
88 $this->string($logo->getMime())->isIdenticalTo('image/png');
89 $this->string($logo->getFormat())->isIdenticalTo('png');
90 $this->boolean($logo->isCustom())->isFalse();
91 }
92 }