]>
git.agnieray.net Git - galette.git/blob - tests/Galette/Core/tests/units/CheckModules.php
4767004adf07cf4fb0149001824a82464d1cd537
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
10 * Copyright © 2016 The Galette Team
12 * This file is part of Galette (http://galette.tuxfamily.org).
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.
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.
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/>.
28 * @package GaletteTests
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2016 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
34 * @link http://galette.tuxfamily.org
38 namespace Galette\Core\test\units
;
43 * CheckModules tests class
47 * @package GaletteTests
48 * @author Johan Cwiklinski <johan@x-tnd.be>
49 * @copyright 2016 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
54 class CheckModules
extends atoum
57 * Test new PasswordImage generation
61 public function testAllOK()
63 $checks = new \Galette\Core\
CheckModules();
64 $this->boolean($checks->isValid())->isTrue();
65 $this->integer(count($checks->getGoods()))
66 ->isLessThanOrEqualTo(10)
67 ->isGreaterThanOrEqualTo(6);
68 $this->array($checks->getMissings())
70 $this->array($checks->getShoulds())
72 $this->boolean($checks->isGood('mbstring'))
77 * Test all extensions missing
81 public function testAllKO()
83 $this->assert('All PHP extensions missing')
84 ->given($checks = new \Galette\Core\
CheckModules(false))
85 ->if($this->function->extension_loaded
= false)
87 ->if($checks->doCheck())
89 ->array($checks->getGoods())
91 ->array($checks->getShoulds())
93 ->array($checks->getMissings())
95 ->string($checks->toHtml())
96 ->notContains('icon-valid.png')
105 public function testToHtml()
107 $checks = new \Galette\Core\
CheckModules();
109 $html = $checks->toHtml();
111 ->notContains('icon-invalid.png')
112 ->length
->isGreaterThanOrEqualTo(908);