diff options
author | sgiehl <stefangiehl@gmail.com> | 2012-10-19 21:47:37 +0400 |
---|---|---|
committer | sgiehl <stefangiehl@gmail.com> | 2012-10-19 21:47:37 +0400 |
commit | 5762ad9e177d844593032133c99881417f56de5b (patch) | |
tree | 81bc88f1f37699f828bf38a15e66e7d3f9f9aa14 /plugins/ExamplePlugin | |
parent | 389c28f97b53cd37d0719366aaa3ada479d7c053 (diff) |
refs #3227 removing plugin simple tests
git-svn-id: http://dev.piwik.org/svn/trunk@7240 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/ExamplePlugin')
-rw-r--r-- | plugins/ExamplePlugin/tests/ExamplePlugin.test.php | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/plugins/ExamplePlugin/tests/ExamplePlugin.test.php b/plugins/ExamplePlugin/tests/ExamplePlugin.test.php deleted file mode 100644 index ff82417ab0..0000000000 --- a/plugins/ExamplePlugin/tests/ExamplePlugin.test.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -if(!defined('PIWIK_CONFIG_TEST_INCLUDED')) -{ - require_once dirname(__FILE__)."/../../../tests/config_test.php"; -} - -class Test_Piwik_ExamplePlugin extends UnitTestCase -{ - function setUp() - { - $path = dirname(__FILE__).'/../config/local.config.php'; - if (file_exists($path)) - { - @unlink($path); - } - - $this->assertFalse(file_exists($path), 'unable to remove local.config.php'); - } - - function test_load_with_no_config() - { - $objectUnderTest = new Piwik_Plugin_Config('ExamplePlugin'); - - $this->assertFalse($objectUnderTest->load(), 'load() with no config should fail'); - } - - function test_load_alternate_path() - { - $objectUnderTest = new Piwik_Plugin_Config('ExamplePlugin', 'local.config.sample.php'); - $config = $objectUnderTest->load(); - - $this->assertTrue($config !== false); - $this->assertTrue($config['id'] === 'Example'); - $this->assertTrue($config['name'] === 'ExamplePlugin'); - $this->assertTrue($config['description'] === 'This is an example'); - } - - function test_load() - { - $dir = dirname(__FILE__).'/../config'; - @copy($dir . '/local.config.sample.php', $dir . '/local.config.php'); - - $objectUnderTest = new Piwik_Plugin_Config('ExamplePlugin'); - $config = $objectUnderTest->load(); - - $this->assertTrue($config !== false); - $this->assertTrue($config['id'] === 'Example'); - $this->assertTrue($config['name'] === 'ExamplePlugin'); - $this->assertTrue($config['description'] === 'This is an example'); - } - - function test_store() - { - $config = array( - 1, 'mixed', array('a'), 'b' => 'c' - ); - - $objectUnderTest = new Piwik_Plugin_Config('ExamplePlugin'); - $objectUnderTest->store($config); - - $path = dirname(__FILE__).'/../config/local.config.php'; - $this->assertTrue(file_exists($path)); - - $objectUnderTest = new Piwik_Plugin_Config('ExamplePlugin'); - $newConfig = $objectUnderTest->load(); - - $this->assertTrue($config !== false); - $this->assertTrue($config[0] === 1); - $this->assertTrue($config[1] === 'mixed'); - $this->assertTrue(is_array($config[2]) && $config[2][0] === 'a'); - $this->assertTrue($config['b'] === 'c'); - } -} |