wrote this file. * As long as you retain this notice you can do whatever you want with * this stuff. If we meet some day, and you think this stuff is worth it, * you can buy me a beer in return. * * @author Sven Strittmatter * @copyright Copyright (c) 2010, Sven Strittmatter. * @version 0.2.2 * @license http://www.weltraumschaf.de/the-beer-ware-license.txt */ /** * Test helper */ require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'TestHelper.php'; require_once 'Api/Kwick/Config.php'; class Api_Kwick_ConfigTest extends PHPUnit_Framework_TestCase { public function testSetAndGet() { $fixture = array( 'foo' => 'bar', 'baz' => 3.1415 ); $config = new Api_Kwick_Config($fixture); foreach ($fixture as $name => $value) { $this->assertTrue($config->has($name)); $this->assertEquals($value, $config->get($name)); } $this->assertFalse($config->has('blub')); $this->assertNull($config->get('blub')); } public function testGetDefault() { $config = new Api_Kwick_Config(array()); $this->assertEquals('bar', $config->get('foo', 'bar')); } }