3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
6 * Dynamic separator tests
10 * Copyright © 2013-2014 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/>.
27 * @category DynamicFields
28 * @package GaletteTests
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2013-2014 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\DynamicFields\test\units
;
43 * Dynamic separator test
45 * @category DynamicFields
47 * @package GaletteTests
48 * @author Johan Cwiklinski <johan@x-tnd.be>
49 * @copyright 2013-2014 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 Separator
extends atoum
62 * @param string $method Current test method
66 public function beforeTestMethod($method)
68 $this->zdb
= new \Galette\Core\
Db();
69 $this->separator
= new \Galette\DynamicFields\
Separator($this->zdb
);
77 public function testConstructor()
79 $o = new \Galette\DynamicFields\
Separator($this->zdb
, 10);
80 $this->variable($o->getId())
81 ->isIdenticalTo(null);
89 public function testGetTypeName()
91 $this->variable($this->separator
->getTypeName())
92 ->isIdenticalTo(_T('separator'));
96 * Test if basic properties are ok
100 public function testBaseProperties()
102 $muliple = $this->separator
->isMultiValued();
103 $this->boolean($muliple)->isFalse();
105 $required = $this->separator
->isRequired();
106 //should'nt that one be false?
107 $this->variable($required)->isNull();
109 $name = $this->separator
->getName();
110 $this->variable($name)->isIdenticalTo('');
112 $has_fixed_values = $this->separator
->hasFixedValues();
113 $this->boolean($has_fixed_values)->isFalse();
115 $has_data = $this->separator
->hasData();
116 $this->boolean($has_data)->isFalse();
118 $has_w = $this->separator
->hasWidth();
119 $this->boolean($has_w)->isFalse();
121 $has_h = $this->separator
->hasHeight();
122 $this->boolean($has_h)->isFalse();
124 $has_s = $this->separator
->hasSize();
125 $this->boolean($has_s)->isFalse();
127 $perms = $this->separator
->getPerm();
128 $this->variable($perms)->isNull();
130 $width = $this->separator
->getWidth();
131 $this->variable($width)->isNull();
133 $height = $this->separator
->getHeight();
134 $this->variable($height)->isNull();
136 $repeat = $this->separator
->getRepeat();
137 $this->variable($repeat)->isNull();
139 $size = $this->separator
->getSize();
140 $this->variable($size)->isNull();
142 $values = $this->separator
->getValues();
143 $this->boolean($values)->isFalse();