Config.php
<?php
namespace Liaison\Test\Compo;
class Config extends \Taeluf\Tester {
public function testDefaultsOrValuesAreAvailableWithNoConflicts(){
$lia = new \Liaison(['bare'=>true]);
$package = new \Liaison\Test\Mock\Package($lia);
$lia->set('blm', $tBlm= 'Cops don\'t fix poverty');
$lia->set('eco', $tEco= 'Plant Pollinator Plants');
$lia->set('prison', $tPrison= 'Too many people are in the American prison system');
$lia->default('pos', $tPos='Love is Free');
$lia->default('consume', 'Buy From Amazon (and support a monopolistic small-business killing mega-corporation)');
$lia->set('consume', $tConsume= 'Buy from a local business; be part of a community.');
return true
&& $this->test('Conf Get')
&& $this->compare($tBlm, $lia->get('blm'))
&& $this->compare($tEco, $lia->get('eco'))
&& $this->compare($tPrison, $lia->get('prison'))
&& $this->test('Lia Get')
&& $this->compare($tBlm, $lia->get('blm'))
&& $this->compare($tEco, $lia->get('eco'))
&& $this->compare($tPrison, $lia->get('prison'))
&& $this->test('Call Api')
&& $this->compare($tBlm, $lia->api('lia:config.get', 'blm'))
&& $this->test('Defaults')
&& $this->compare($tPos, $lia->get('pos'))
&& $this->compare($tPos, $lia->get('pos'))
&& $this->compare($tConsume, $lia->get('consume'))
&& $this->compare($tConsume, $lia->get('consume'))
;
}
}
Config::runAll();