aboutsummaryrefslogtreecommitdiff
path: root/vendor/flexi/test
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/flexi/test')
-rw-r--r--vendor/flexi/test/all_tests.php41
-rw-r--r--vendor/flexi/test/coverage.php43
-rw-r--r--vendor/flexi/test/flexi_tests.php61
-rw-r--r--vendor/flexi/test/lib/helper/js_helper_test.php93
-rw-r--r--vendor/flexi/test/lib/helper/prototype_helper_test.php180
-rw-r--r--vendor/flexi/test/lib/helper/scriptaculous_helper_test.php67
-rw-r--r--vendor/flexi/test/lib/helper/tag_helper_test.php65
-rw-r--r--vendor/flexi/test/lib/helper/text_helper_test.php80
-rw-r--r--vendor/flexi/test/lib/js_template_test.php56
-rw-r--r--vendor/flexi/test/lib/php_template_test.php182
-rw-r--r--vendor/flexi/test/lib/template_factory_test.php117
-rw-r--r--vendor/flexi/test/lib/template_test.php215
-rw-r--r--vendor/flexi/test/templates/factory_tests/baz.unknown_extension0
-rw-r--r--vendor/flexi/test/templates/factory_tests/foo.php1
-rw-r--r--vendor/flexi/test/templates/layout_with_partials/layout.php3
-rw-r--r--vendor/flexi/test/templates/layout_with_partials/partial.php1
-rw-r--r--vendor/flexi/test/templates/layout_with_partials/template.php1
-rw-r--r--vendor/flexi/test/templates/template_tests/attributes.php3
-rw-r--r--vendor/flexi/test/templates/template_tests/foo.php1
-rw-r--r--vendor/flexi/test/templates/template_tests/foo_using_partial.php1
-rw-r--r--vendor/flexi/test/templates/template_tests/foo_with_partial_collection.php1
-rw-r--r--vendor/flexi/test/templates/template_tests/foos_partial.php1
-rw-r--r--vendor/flexi/test/templates/template_tests/item.php1
-rw-r--r--vendor/flexi/test/templates/template_tests/layouts/layout.php1
-rw-r--r--vendor/flexi/test/templates/template_tests/spacer.php1
-rw-r--r--vendor/flexi/test/varstream.php244
26 files changed, 0 insertions, 1460 deletions
diff --git a/vendor/flexi/test/all_tests.php b/vendor/flexi/test/all_tests.php
deleted file mode 100644
index 939413a..0000000
--- a/vendor/flexi/test/all_tests.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-# load required files
-require_once 'simpletest/unit_tester.php';
-require_once 'simpletest/reporter.php';
-require_once 'simpletest/collector.php';
-
-
-# collect all tests
-$all = new TestSuite('All tests');
-
-$all->collect(dirname(__FILE__).'/lib', new SimplePatternCollector('/test.php$/'));
-$all->collect(dirname(__FILE__).'/lib/helper', new SimplePatternCollector('/test.php$/'));
-
-# use text reporter if cli
-if (sizeof($_SERVER['argv']))
- $all->run(new TextReporter());
-
-# use html reporter if cgi
-else
- $all->run(new HtmlReporter());
diff --git a/vendor/flexi/test/coverage.php b/vendor/flexi/test/coverage.php
deleted file mode 100644
index cbf694a..0000000
--- a/vendor/flexi/test/coverage.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-# Copyright (c) 2007 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-
-$PHPCOVERAGE_HOME = '/usr/share/php/spikephpcoverage/src/';
-$PHPCOVERAGE_REPORT_DIR = '/tmp/report/';
-$PHPCOVERAGE_APPBASE_PATH = '/tmp/report/';
-
-require_once $PHPCOVERAGE_HOME . 'phpcoverage.inc.php';
-require_once $PHPCOVERAGE_HOME . 'CoverageRecorder.php';
-require_once $PHPCOVERAGE_HOME . 'reporter/HtmlCoverageReporter.php';
-
-$reporter = new HtmlCoverageReporter('Code Coverage Report', '', $PHPCOVERAGE_REPORT_DIR);
-
-$includePaths = array('../lib');
-$excludePaths = array();
-$cov = new CoverageRecorder($includePaths, $excludePaths, $reporter);
-
-$cov->startInstrumentation();
-include 'all_tests.php';
-$cov->stopInstrumentation();
-
-$cov->generateReport();
-$reporter->printTextSummary();
diff --git a/vendor/flexi/test/flexi_tests.php b/vendor/flexi/test/flexi_tests.php
deleted file mode 100644
index d012ffc..0000000
--- a/vendor/flexi/test/flexi_tests.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once 'simpletest/unit_tester.php';
-require_once 'simpletest/mock_objects.php';
-require_once 'simpletest/autorun.php';
-
-require_once 'varstream.php';
-
-/**
- * Setting up tests for flexi.
- *
- * @package flexi
- * @subpackage test
- *
- * @author mlunzena
- * @copyright (c) Authors
- * @version $Id$
- */
-
-class Flexi_Tests {
-
- /**
- * Calling this function initializes everything necessary to test flexi.
- *
- * @return void
- */
- function setup() {
- static $once;
-
- if (!$once) {
-
- # define TEST_DIR
- define('TEST_DIR', dirname(__FILE__));
-
- # load required files
- require_once TEST_DIR . '/../lib/flexi.php';
-
- $once = TRUE;
- }
- }
-}
diff --git a/vendor/flexi/test/lib/helper/js_helper_test.php b/vendor/flexi/test/lib/helper/js_helper_test.php
deleted file mode 100644
index f7c36ff..0000000
--- a/vendor/flexi/test/lib/helper/js_helper_test.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../../flexi_tests.php';
-Flexi_Tests::setup();
-require_once dirname(__FILE__) . '/../../../lib/helper/js_helper.php';
-
-/**
- * Testcase for JsHelper.
- *
- * @package flexi
- * @subpackage test
- *
- * @author mlunzena
- * @copyright (c) Authors
- * @version $Id: js_helper_test.php 4194 2006-10-24 14:52:31Z mlunzena $
- */
-
-class JsHelperTestCase extends UnitTestCase {
-
- function setUp() {
- }
-
- function tearDown() {
- }
-
-
- function test_link_to_function() {
- $foo = JsHelper::link_to_function('Greeting', "alert('Hello world!')",
- array('title' => 'hello'));
- $exp = '<a title="hello" href="#" onclick="alert(\'Hello world!\'); '.
- 'return false;">Greeting</a>';
- $this->assertEqual($exp, $foo);
- }
-
- function test_button_to_function() {
- $foo = JsHelper::button_to_function("Greeting", "alert('Hello world!')");
- $exp = '<input type="button" value="Greeting" '.
- 'onclick="alert(\'Hello world!\');" />';
- $this->assertEqual($exp, $foo);
-
- $foo = JsHelper::button_to_function("Greeting", "alert('Hello world!')",
- array('onclick' => 'alert(\'One\')'));
- $exp = '<input onclick="alert(\'One\'); alert(\'Hello world!\');" '.
- 'type="button" value="Greeting" />';
- $this->assertEqual($exp, $foo);
- }
-
- function test_escape_javascript() {
- $strings = array(
- "\r" => '\n',
- "\n" => '\n',
- '\\' => '\\\\',
- '</' => '<\\/',
- '"' => '\\"',
- "'" => "\\'"
- );
- foreach ($strings as $string => $expect) {
- $this->assertEqual(JsHelper::escape_javascript($string), $expect);
- }
- }
-
- function test_javascript_tag() {
- $foo = JsHelper::javascript_tag("alert('All is good')");
- $exp = <<<EXPECTED
-<script type="text/javascript">
-//<![CDATA[
-alert('All is good')
-//]]>
-</script>
-EXPECTED;
- $this->assertEqual($exp, $foo);
- }
-}
diff --git a/vendor/flexi/test/lib/helper/prototype_helper_test.php b/vendor/flexi/test/lib/helper/prototype_helper_test.php
deleted file mode 100644
index 3307f6a..0000000
--- a/vendor/flexi/test/lib/helper/prototype_helper_test.php
+++ /dev/null
@@ -1,180 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../../flexi_tests.php';
-Flexi_Tests::setup();
-require_once dirname(__FILE__) . '/../../../lib/helper/prototype_helper.php';
-
-/**
- * Testcase for JsHelper.
- *
- * @package flexi
- * @subpackage test
- *
- * @author mlunzena
- * @copyright (c) Authors
- * @version $Id: prototype_helper_test.php 4194 2006-10-24 14:52:31Z mlunzena $
- */
-
-class PrototypeHelperTestCase extends UnitTestCase {
-
- function setUp() {
- }
-
- function tearDown() {
- }
-
- function test_link_to_remote() {
-
- $foo = PrototypeHelper::link_to_remote('Delete this post',
- array('update' => 'posts',
- 'url' => 'http://destroy?id=1'));
- $exp = '<a href="#" onclick="new Ajax.Updater(\'posts\', \'http://destroy?id=1\', {asynchronous:true, evalScripts:false}); return false;">Delete this post</a>';
- $this->assertEqual($exp, $foo);
-
-
- $foo = PrototypeHelper::link_to_remote('Delete this post',
- array('update' => array('success' => 'posts',
- 'failure' => 'error'),
- 'url' => 'http://destroy?id=1'));
- $exp = '<a href="#" onclick="new Ajax.Updater({success:\'posts\',failure:\'error\'}, \'http://destroy?id=1\', {asynchronous:true, evalScripts:false}); return false;">Delete this post</a>';
- $this->assertEqual($exp, $foo);
-
-
- $foo = PrototypeHelper::link_to_remote('Delete this post',
- array('url' => 'http://destroy?id=1',
- 404 => "alert('Not found...?')",
- 'failure' => "alert('HTTPError!')"));
- $exp = '<a href="#" onclick="new Ajax.Request(\'http://destroy?id=1\', {asynchronous:true, evalScripts:false, on404:function(request, json){alert(\'Not found...?\')}, onFailure:function(request, json){alert(\'HTTPError!\')}}); return false;">Delete this post</a>';
- $this->assertEqual($exp, $foo);
- }
-
- function test_periodically_call_remote() {
- $foo = PrototypeHelper::periodically_call_remote(
- array('url' => 'http://clock',
- 'frequency' => 2,
- 'update' => 'clock'));
- $exp = <<<EXPECTED
-<script type="text/javascript">
-//<![CDATA[
-new PeriodicalExecuter(function() {new Ajax.Updater('clock', 'http://clock', {asynchronous:true, evalScripts:false})}, 2)
-//]]>
-</script>
-EXPECTED;
- $this->assertEqual($exp, $foo);
- }
-
- function test_form_remote_tag() {
-
- $foo = PrototypeHelper::form_remote_tag(array(
- 'url' => 'http://tag_add',
- 'update' => 'question_tags',
- 'loading' => "Element.show('indicator'); tag.value = '';",
- 'complete' => "Element.hide('indicator');"));
- $exp = <<<EXPECTED
-<form onsubmit="new Ajax.Updater('question_tags', 'http://tag_add', {asynchronous:true, evalScripts:false, onComplete:function(request, json){Element.hide('indicator');}, onLoading:function(request, json){Element.show('indicator'); tag.value = '';}, parameters:Form.serialize(this)}); return false;" action="http://tag_add" method="post">
-EXPECTED;
- $this->assertEqual($exp, $foo);
- }
-
- function test_submit_to_remote() {
- $foo = PrototypeHelper::submit_to_remote('name', 'value',
- array(
- 'url' => 'http://tag_add',
- 'update' => 'question_tags',
- 'loading' => "Element.show('indicator'); tag.value = '';",
- 'complete' => "Element.hide('indicator');"));
- $exp = <<<EXPECTED
-<input type="button" onclick="new Ajax.Updater('question_tags', 'http://tag_add', {asynchronous:true, evalScripts:false, onComplete:function(request, json){Element.hide('indicator');}, onLoading:function(request, json){Element.show('indicator'); tag.value = '';}, parameters:Form.serialize(this.form)}); return false;" name="name" value="value" />
-EXPECTED;
- $this->assertEqual($exp, $foo);
- }
-
- function test_update_element_function() {
- $foo = PrototypeHelper::update_element_function('element_id',
- array('position' => 'bottom', 'content' => "<p>New product!</p>"));
- $exp = "new Insertion.Bottom('element_id','<p>New product!<\/p>');\n";
- $this->assertEqual($exp, $foo);
- }
-
- function test_evaluate_remote_response() {
- $foo = PrototypeHelper::evaluate_remote_response();
- $exp = 'eval(request.responseText)';
- $this->assertEqual($exp, $foo);
- }
-
- function test_remote_function() {
- $foo = PrototypeHelper::remote_function(array('update' => 'options',
- 'url' => 'http://update'));
- $exp = <<<EXPECTED
-new Ajax.Updater('options', 'http://update', {asynchronous:true, evalScripts:false})
-EXPECTED;
- $this->assertEqual($exp, $foo);
- }
-
- function test_observe_field() {
- $foo = PrototypeHelper::observe_field('element_id',
- array('url' => 'http://update',
- 'frequency' => 0,
- 'update' => 'update_id'));
- $exp = <<<EXPECTED
-<script type="text/javascript">
-//<![CDATA[
-new Form.Element.EventObserver("element_id", 0, function(element, value) {new Ajax.Updater('update_id', 'http://update', {asynchronous:true, evalScripts:false, parameters:value})});
-//]]>
-</script>
-EXPECTED;
- $this->assertEqual($exp, $foo);
- }
-
- function test_observe_form() {
- $foo = PrototypeHelper::observe_form('form_id',
- array('url' => 'http://update',
- 'frequency' => 0,
- 'update' => 'update_id'));
- $exp = <<<EXPECTED
-<script type="text/javascript">
-//<![CDATA[
-new Form.EventObserver("form_id", 0, function(element, value) {new Ajax.Updater('update_id', 'http://update', {asynchronous:true, evalScripts:false, parameters:value})});
-//]]>
-</script>
-EXPECTED;
- $this->assertEqual($exp, $foo);
- }
-
- function test_jsgen() {
- $page = new Flexi_JavascriptGenerator();
- $page->insert_html('bottom', 'list', '<li>Last item</li>');
- $page->replace_html('person-45', 'Deleted.');
- $page->replace('person-45', 'Deleted.');
- $page->remove('id-1', 'id-2', 'id-3');
- $page->show('id-1', 'id-2', 'id-3');
- $page->hide('id-1', 'id-2', 'id-3');
- $page->toggle('id-1', 'id-2', 'id-3');
- $page->alert('Some "Message"!\/');
- $page->redirect_to('http://www.google.com');
- $page->delay('alert("Hallo Welt")', 23);
- $page->visual_effect('highlight', 'id-42');
- # TODO (mlunzena) no asserts
- # var_dump($page->to_s());
- }
-}
diff --git a/vendor/flexi/test/lib/helper/scriptaculous_helper_test.php b/vendor/flexi/test/lib/helper/scriptaculous_helper_test.php
deleted file mode 100644
index 30531f9..0000000
--- a/vendor/flexi/test/lib/helper/scriptaculous_helper_test.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../../flexi_tests.php';
-Flexi_Tests::setup();
-require_once dirname(__FILE__) . '/../../../lib/helper/scriptaculous_helper.php';
-
-/**
- * Testcase for ScriptaculousHelper.
- *
- * @package flexi
- * @subpackage test
- *
- * @author mlunzena
- * @copyright (c) Authors
- * @version $Id$
- */
-
-class ScriptaculousHelperTestCase extends UnitTestCase {
-
- function setUp() {
- }
-
- function tearDown() {
- }
-
- function test_visual_effect() {
- $result = ScriptaculousHelper::visual_effect('toggle_blind', 'id');
- $expected = 'new Effect.toggle(\'id\', \'blind\', {})';
- $this->assertEqual($result, $expected);
- }
-
- function test_sortable_element() {
- $result = ScriptaculousHelper::sortable_element('list', array(
- 'url' => '/',
- 'containment' => array('left', 'right'),
- 'only' => 'middle',
- ));
- $expected = <<<SCRIPT
-<script type="text/javascript">
-//<![CDATA[
-Sortable.create('list', {containment:['left','right'], onUpdate:function(){new Ajax.Request('/', {asynchronous:true, evalScripts:false, parameters:Sortable.serialize('list')})}, only:'middle'})
-//]]>
-</script>
-SCRIPT;
- $this->assertEqual($result, $expected);
- }
-}
diff --git a/vendor/flexi/test/lib/helper/tag_helper_test.php b/vendor/flexi/test/lib/helper/tag_helper_test.php
deleted file mode 100644
index bd872f7..0000000
--- a/vendor/flexi/test/lib/helper/tag_helper_test.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../../flexi_tests.php';
-Flexi_Tests::setup();
-require_once dirname(__FILE__) . '/../../../lib/helper/tag_helper.php';
-
-/**
- * Testcase for TagHelper.
- *
- * @package flexi
- * @subpackage test
- *
- * @author mlunzena
- * @copyright (c) Authors
- * @version $Id: tag_helper_test.php 4194 2006-10-24 14:52:31Z mlunzena $
- */
-
-class TagHelperTestCase extends UnitTestCase {
-
- function setUp() {
- }
-
- function tearDown() {
- }
-
- function test_tag() {
- $foo = TagHelper::tag('img', array('src' => 'test.gif'));
- $this->assertEqual('<img src="test.gif" />', $foo);
- }
-
- function test_content_tag() {
- $foo = TagHelper::content_tag('a', '#', array('href' => '#'));
- $this->assertEqual('<a href="#">#</a>', $foo);
- }
-
- function test_cdata_section() {
- $foo = TagHelper::cdata_section('foo');
- $this->assertEqual('<![CDATA[foo]]>', $foo);
- }
-
- function test_string_to_array() {
- $array = TagHelper::string_to_array('id="anId" class=\'aClass\'');
- $this->assertEqual(array('id' => 'anId', 'class' => 'aClass'), $array);
- }
-}
diff --git a/vendor/flexi/test/lib/helper/text_helper_test.php b/vendor/flexi/test/lib/helper/text_helper_test.php
deleted file mode 100644
index 1ac7834..0000000
--- a/vendor/flexi/test/lib/helper/text_helper_test.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../../flexi_tests.php';
-Flexi_Tests::setup();
-require_once dirname(__FILE__) . '/../../../lib/helper/text_helper.php';
-
-/**
- * Testcase for TextHelper.
- *
- * @package flexi
- * @subpackage test
- *
- * @author mlunzena
- * @copyright (c) Authors
- * @version $Id$
- */
-
-class TextHelperTestCase extends UnitTestCase {
-
- function setUp() {
- }
-
- function tearDown() {
- TextHelper::reset_cycle();
- }
-
- function test_camelize() {
- $foo = TextHelper::camelize('foo_bar_baz/FOO is great');
- $this->assertEqual('FooBarBazFOOIsGreat', $foo);
- }
-
- function test_simple_cycle() {
- $this->assertEqual('odd', TextHelper::cycle('odd', 'even'));
- $this->assertEqual('even', TextHelper::cycle('odd', 'even'));
- $this->assertEqual('odd', TextHelper::cycle('odd', 'even'));
- $this->assertEqual('even', TextHelper::cycle('odd', 'even'));
- }
-
- function test_reset_cycle() {
- $this->assertEqual('odd', TextHelper::cycle('odd', 'even'));
- $this->assertEqual('even', TextHelper::cycle('odd', 'even'));
- $this->assertEqual('odd', TextHelper::cycle('odd', 'even'));
- TextHelper::reset_cycle();
- $this->assertEqual('odd', TextHelper::cycle('odd', 'even'));
- }
-
- function test_double_cycle_should_reset_each_time() {
- $this->assertEqual('odd', TextHelper::cycle('odd', 'even'));
- $this->assertEqual('red', TextHelper::cycle('red', 'black'));
- $this->assertEqual('odd', TextHelper::cycle('odd', 'even'));
- $this->assertEqual('red', TextHelper::cycle('red', 'black'));
- }
-
- function test_named_cycles() {
- $this->assertEqual('odd', TextHelper::cycle(array('odd', 'even', 'name' => '1st')));
- $this->assertEqual('red', TextHelper::cycle('red', 'black'));
- $this->assertEqual('even', TextHelper::cycle(array('odd', 'even', 'name' => '1st')));
- $this->assertEqual('black', TextHelper::cycle('red', 'black'));
- }
-}
diff --git a/vendor/flexi/test/lib/js_template_test.php b/vendor/flexi/test/lib/js_template_test.php
deleted file mode 100644
index 77f577b..0000000
--- a/vendor/flexi/test/lib/js_template_test.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../flexi_tests.php';
-Flexi_Tests::setup();
-
-class JsTemplateTestCase extends UnitTestCase {
-
- var $factory;
-
- function setUp() {
- $this->setUpFS();
- $this->factory = new Flexi_TemplateFactory('var://templates/');
- }
-
- function tearDown() {
- unset($this->factory);
-
- stream_wrapper_unregister("var");
- }
-
- function setUpFS() {
- ArrayFileStream::set_filesystem(array(
- 'templates' => array(
- 'foo.pjs' => '',
- 'layout.pjs' => ''
- )));
- stream_wrapper_register("var", "ArrayFileStream") or die("Failed to register protocol");
- }
-
-
- function test_something() {
- $template = $this->factory->open('foo');
- $template->render(array('whom' => 'world'), 'layout');
- }
-}
-
diff --git a/vendor/flexi/test/lib/php_template_test.php b/vendor/flexi/test/lib/php_template_test.php
deleted file mode 100644
index 1c6d85c..0000000
--- a/vendor/flexi/test/lib/php_template_test.php
+++ /dev/null
@@ -1,182 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../flexi_tests.php';
-Flexi_Tests::setup();
-
-class PhpTemplateTestCase extends UnitTestCase {
-
- var $factory;
-
-
- function setUp() {
- $this->setUpFS();
- $this->factory = new Flexi_TemplateFactory('var://templates/');
- }
-
-
- function tearDown() {
- unset($this->factory);
-
- stream_wrapper_unregister("var");
- }
-
- function setUpFS() {
- ArrayFileStream::set_filesystem(array(
- 'templates' => array(
-
- 'foo_using_partial.php' =>
- 'Hello, <?= $this->render_partial("foos_partial") ?>!',
-
- 'foos_partial.php' =>
- '<h1><?= $whom ?> at <?= $when ?></h1>',
-
- 'foo_with_partial_collection.php' =>
- '[<?= $this->render_partial_collection("item", $items, "spacer") ?>]',
-
- 'item.php' =>
- '"<?= $item ?>"',
-
- 'spacer.php' =>
- ', ',
-
- 'attributes.php' =>
- '<? foreach (get_defined_vars() as $name => $value) : ?>' .
- '<?= $name ?><?= $value ?>'.
- '<? endforeach ?>',
-
- 'foo.php' =>
- 'Hello, <?= $whom ?>!',
-
- 'layout.php' =>
- '[<?= $content_for_layout ?>]',
- )));
- stream_wrapper_register("var", "ArrayFileStream") or die("Failed to register protocol");
- }
-
- function test_render_partial() {
- $template = $this->factory->open('foo_using_partial');
- $template->set_attribute('whom', 'bar');
- $output = $template->render(array('when' => 'now'));
- $spec = "Hello, <h1>bar at now</h1>!";
- $this->assertEqual($output, $spec);
- }
-
-
- function test_render_partial_collection() {
- $template = $this->factory->open('foo_with_partial_collection');
- $result = $template->render_partial_collection('item',
- range(1, 3),
- 'spacer');
- $this->assertEqual('"1", "2", "3"', $result);
- }
-
-
- function test_should_override_attributes_with_those_passed_to_render() {
-
- $template = $this->factory->open('attributes');
- $template->set_attribute('foo', 'baz');
-
- $template->render(array('foo' => 'bar'));
-
- $bar = $template->get_attribute('foo');
- $this->assertEqual($bar, 'bar');
-
- $out = $template->render();
-
- $bar = $template->get_attribute('foo');
- $this->assertEqual($bar, 'bar');
- }
-
- function test_render_without_layout() {
- $foo = $this->factory->open('foo');
- $foo->set_attribute('whom', 'bar');
- $out = $foo->render();
- $this->assertEqual('Hello, bar!', $out);
- }
-
- function test_render_with_layout() {
- $foo = $this->factory->open('foo');
- $foo->set_attribute('whom', 'bar');
- $foo->set_layout('layout');
- $out = $foo->render();
- $this->assertEqual('[Hello, bar!]', $out);
- }
-
- function test_render_with_layout_inline() {
- $out = $this->factory->render('foo', array('whom' => 'bar'), 'layout');
- $this->assertEqual('[Hello, bar!]', $out);
- }
-
- function test_render_with_missing_layout() {
- $foo = $this->factory->open('foo');
- $this->expectException("Flexi_TemplateNotFoundException");
- $foo->set_layout('nosuchlayout');
- }
-
- function test_render_with_attributes() {
- $foo = $this->factory->open('foo');
- $foo->set_attribute('whom', 'bar');
- $foo->set_layout('layout');
- $foo_out = $foo->render();
-
- $bar = $this->factory->open('foo');
- $bar_out = $bar->render(array('whom' => 'bar'), 'layout');
-
- $this->assertEqual($foo_out, $bar_out);
- }
-}
-
-
-class PhpTemplatePartialBugTestCase extends UnitTestCase {
- function setUp() {
- $this->setUpFS();
- $this->factory = new Flexi_TemplateFactory('var://templates/');
- }
-
- function tearDown() {
- unset($this->factory);
-
- stream_wrapper_unregister("var");
- }
-
- function setUpFS() {
- ArrayFileStream::set_filesystem(array(
- 'templates' => array(
- 'layout.php' =>
- '<? $do_not_echo_this = $this->render_partial_collection("partial", range(1, 5));'.
- 'echo $content_for_layout;',
- 'partial.php' =>
- 'partial',
- 'template.php' =>
- 'template',
- )));
- stream_wrapper_register("var", "ArrayFileStream") or die("Failed to register protocol");
- }
-
- function test_partial_bug() {
- $template = $this->factory->open('template');
- $template->set_layout('layout');
- $result = $template->render();
- $this->assertEqual($result, "template");
- }
-}
diff --git a/vendor/flexi/test/lib/template_factory_test.php b/vendor/flexi/test/lib/template_factory_test.php
deleted file mode 100644
index c2166da..0000000
--- a/vendor/flexi/test/lib/template_factory_test.php
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../flexi_tests.php';
-Flexi_Tests::setup();
-
-/**
- * Testcase for TemplateFactory.php.
- *
- * @package flexi
- * @subpackage test
- *
- * @author mlunzena
- * @copyright (c) Authors
- * @version $Id: template_test.php 4194 2006-10-24 14:52:31Z mlunzena $
- */
-
-class TemplateFactoryTestCase extends UnitTestCase {
-
- var $factory;
-
- function setUp() {
- $this->setUpFS();
- $this->factory = new Flexi_TemplateFactory('var://templates');
- }
-
- function tearDown() {
- unset($this->factory);
- stream_wrapper_unregister("var");
- }
-
- function setUpFS() {
- ArrayFileStream::set_filesystem(array(
- 'templates' => array(
- 'foo.php' => 'some content',
- 'baz.unknown' => 'some content',
- 'multiplebasenames' => array(
- 'foo.txt' => 'there is no matching template class',
- 'foo.php' => 'some content',
- 'bar.txt' => 'there is no matching template class'
- )
- )
- ));
- stream_wrapper_register("var", "ArrayFileStream")
- or die("Failed to register protocol");
- }
-
- function test_should_create_factory() {
- $factory = new Flexi_TemplateFactory('.');
- $this->assertNotNull($factory);
- }
-
- function test_should_create_factory_using_path() {
- $path = 'var://';
- $factory = new Flexi_TemplateFactory($path);
- $this->assertNotNull($factory);
- }
-
- function test_should_open_template_using_relative_path() {
- $foo = $this->factory->open('foo');
- $this->assertNotNull($foo);
- }
-
- function test_should_open_template_using_absolute_path() {
- $foo = $this->factory->open('var://templates/foo');
- $this->assertNotNull($foo);
- }
-
- function test_should_throw_an_exception_opening_a_missing_template_without_file_extension() {
- $this->expectException('Flexi_TemplateNotFoundException');
- $bar = $this->factory->open('bar');
- }
-
- function test_should_throw_an_exception_opening_a_missing_template_with_file_extension() {
- $this->expectException('Flexi_TemplateNotFoundException');
- $bar = $this->factory->open('bar.php');
- }
-
- function test_should_open_template_using_extension() {
- $foo = $this->factory->open('foo.php');
- $this->assertIsA($foo, 'Flexi_PhpTemplate');
- }
-
- function test_should_throw_an_exception_when_opening_a_template_with_unknown_extension() {
- $this->expectException('Flexi_TemplateNotFoundException');
- $baz = $this->factory->open('baz');
- }
-
- function test_should_throw_an_exception_opening_a_template_in_a_non_existing_directory() {
- $this->expectException('Flexi_TemplateNotFoundException');
- $this->factory->open('doesnotexist/foo');
- }
-
- function test_should_search_for_a_supported_template() {
- $template = $this->factory->open('multiplebasenames/foo');
- $this->assertIsA($template, 'Flexi_PhpTemplate');
- }
-}
diff --git a/vendor/flexi/test/lib/template_test.php b/vendor/flexi/test/lib/template_test.php
deleted file mode 100644
index e0f2e0b..0000000
--- a/vendor/flexi/test/lib/template_test.php
+++ /dev/null
@@ -1,215 +0,0 @@
-<?php
-
-# Copyright (c) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require_once dirname(__FILE__) . '/../flexi_tests.php';
-Flexi_Tests::setup();
-
-Mock::generate('Flexi_TemplateFactory');
-Mock::generatePartial('Flexi_Template', 'MockTemplate', array('_render'));
-
-class AnEmptyTemplate extends UnitTestCase {
-
-
- var $factory;
-
-
- function setUp() {
- $this->factory = new MockFlexi_TemplateFactory(TEST_DIR . '/templates/template_tests');
- $template = new MockTemplate();
- $template->__construct('foo', $this->factory);
- $this->factory->setReturnValue('open', $template);
- }
-
-
- function tearDown() {
- unset($this->factory);
- }
-
-
- function test_should_have_no_attributes() {
- $template = $this->factory->open('');
- $this->assertEqual(0, sizeof($template->get_attributes()));
- }
-
-
- function test_should_not_be_empty_after_setting_an_attribute() {
- $template = $this->factory->open('');
- $template->set_attribute('foo', 'bar');
- $this->assertNotEqual(0, sizeof($template->get_attributes()));
- }
-
-
- function test_should_be_empty_after_clear() {
-
- $template = $this->factory->open('foo');
-
- $this->assertEqual(0, sizeof($template->get_attributes()));
-
- $template->clear_attributes();
- $this->assertEqual(0, sizeof($template->get_attributes()));
- }
-}
-
-
-class ATemplate extends UnitTestCase {
-
-
- var $factory;
-
-
- function setUp() {
- $this->factory = new MockFlexi_TemplateFactory(TEST_DIR . '/templates/template_tests');
- $template = new MockTemplate();
- $template->__construct('foo', $this->factory);
- $this->factory->setReturnValue('open', $template);
- }
-
-
- function tearDown() {
- unset($this->factory);
- }
-
-
- function test_should_return_an_previously_set_attribute() {
- $template = $this->factory->open('foo');
- $template->set_attribute('whom', 'bar');
- $this->assertEqual('bar', $template->get_attribute('whom'));
- }
-
-
- function test_should_return_previously_set_attributes() {
-
- $template = $this->factory->open('foo');
- $template->set_attributes(array('whom' => 'bar', 'foo' => 'baz'));
-
- $attributes = $template->get_attributes();
- $this->assertIsA($attributes, 'array');
- $this->assertEqual(2, sizeof($attributes));
- $this->assertEqual('bar', $attributes['whom']);
- $this->assertEqual('baz', $attributes['foo']);
- }
-
-
- function test_should_merge_attributes_with_set_attributes() {
-
- $template = $this->factory->open('foo');
- $template->set_attributes(array('a' => 1, 'b' => 2));
-
- $this->assertEqual(2, sizeof($template->get_attributes()));
- $this->assertEqual(1, $template->get_attribute('a'));
- $this->assertEqual(2, $template->get_attribute('b'));
-
- $template->set_attributes(array('b' => 8, 'c' => 9));
-
- $this->assertEqual(3, sizeof($template->get_attributes()));
- $this->assertEqual(1, $template->get_attribute('a'));
- $this->assertEqual(8, $template->get_attribute('b'));
- $this->assertEqual(9, $template->get_attribute('c'));
- }
-
-
- function test_should_be_empty_after_clear() {
-
- $template = $this->factory->open('foo');
-
- $template->set_attributes(array('a' => 1, 'b' => 2));
- $this->assertNotEqual(0, sizeof($template->get_attributes()));
-
- $template->clear_attributes();
- $this->assertEqual(0, sizeof($template->get_attributes()));
- }
-}
-
-
-
-class MagicMethodsTemplate extends UnitTestCase {
-
-
- var $factory;
-
-
- function setUp() {
- $this->factory = new MockFlexi_TemplateFactory(TEST_DIR . '/templates/template_tests');
- $this->template = new MockTemplate();
- $this->template->__construct('foo', $this->factory);
- }
-
-
- function tearDown() {
- unset($this->factory);
- unset($this->template);
- }
-
-
- function test_should_set_an_attribute_using_the_magic_methods() {
- $this->template->foo = 'bar';
- $this->assertEqual('bar', $this->template->get_attribute('foo'));
- }
-
-
- function test_should_not_set_a_protected_member_field_as_an_attribute() {
- $this->template->_layout = 'bar';
- $this->assertNull($this->template->get_attribute('_layout'));
- $this->assertEqual('bar', $this->template->_layout);
- }
-
- function test_should_overwrite_an_attribute() {
- $this->template->set_attribute('foo', 'bar');
- $this->template->foo = 'baz';
- $this->assertEqual('baz', $this->template->get_attribute('foo'));
- }
-
- function test_should_return_an_existing_attribute_using_the_magic_methods() {
- $this->template->set_attribute('foo', 'bar');
- $this->assertEqual('bar', $this->template->foo);
- }
-
-
- function test_should_return_null_for_a_non_existing_attribute_using_the_magic_methods() {
- $this->assertNull($this->template->foo);
- }
-
-
- function test_should_unset_an_attribute_using_the_magic_methods() {
- $this->template->foo = 'bar';
- unset($this->template->foo);
- $this->assertNull($this->template->foo);
- }
-
-
- function test_should_return_null_on_unsetting_a_non_attribute() {
- unset($this->template->foo);
- $this->assertNull($this->template->foo);
- }
-
-
- function test_should_return_true_on_isset_for_an_attribute() {
- $this->template->foo = 'bar';
- $this->assertTrue(isset($this->template->foo));
- }
-
-
- function test_should_return_false_on_isset_for_a_non_existing_attribute() {
- $this->assertFalse(isset($this->template->foo));
- }
-}
-
diff --git a/vendor/flexi/test/templates/factory_tests/baz.unknown_extension b/vendor/flexi/test/templates/factory_tests/baz.unknown_extension
deleted file mode 100644
index e69de29..0000000
--- a/vendor/flexi/test/templates/factory_tests/baz.unknown_extension
+++ /dev/null
diff --git a/vendor/flexi/test/templates/factory_tests/foo.php b/vendor/flexi/test/templates/factory_tests/foo.php
deleted file mode 100644
index 0150355..0000000
--- a/vendor/flexi/test/templates/factory_tests/foo.php
+++ /dev/null
@@ -1 +0,0 @@
-Hallo, <?= $whom ?>! \ No newline at end of file
diff --git a/vendor/flexi/test/templates/layout_with_partials/layout.php b/vendor/flexi/test/templates/layout_with_partials/layout.php
deleted file mode 100644
index a037f25..0000000
--- a/vendor/flexi/test/templates/layout_with_partials/layout.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?
-$do_not_echo_this = $this->render_partial_collection('partial', range(1, 5));
-echo $content_for_layout ?>
diff --git a/vendor/flexi/test/templates/layout_with_partials/partial.php b/vendor/flexi/test/templates/layout_with_partials/partial.php
deleted file mode 100644
index b648ac9..0000000
--- a/vendor/flexi/test/templates/layout_with_partials/partial.php
+++ /dev/null
@@ -1 +0,0 @@
-partial
diff --git a/vendor/flexi/test/templates/layout_with_partials/template.php b/vendor/flexi/test/templates/layout_with_partials/template.php
deleted file mode 100644
index 3236cba..0000000
--- a/vendor/flexi/test/templates/layout_with_partials/template.php
+++ /dev/null
@@ -1 +0,0 @@
-template
diff --git a/vendor/flexi/test/templates/template_tests/attributes.php b/vendor/flexi/test/templates/template_tests/attributes.php
deleted file mode 100644
index 8ee269a..0000000
--- a/vendor/flexi/test/templates/template_tests/attributes.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<? foreach (get_defined_vars() as $name => $value) : ?>
-<?= $name ?><?= $value ?>
-<? endforeach ?>
diff --git a/vendor/flexi/test/templates/template_tests/foo.php b/vendor/flexi/test/templates/template_tests/foo.php
deleted file mode 100644
index 0150355..0000000
--- a/vendor/flexi/test/templates/template_tests/foo.php
+++ /dev/null
@@ -1 +0,0 @@
-Hallo, <?= $whom ?>! \ No newline at end of file
diff --git a/vendor/flexi/test/templates/template_tests/foo_using_partial.php b/vendor/flexi/test/templates/template_tests/foo_using_partial.php
deleted file mode 100644
index 813a0b6..0000000
--- a/vendor/flexi/test/templates/template_tests/foo_using_partial.php
+++ /dev/null
@@ -1 +0,0 @@
-Hallo, <?= $this->render_partial('foos_partial') ?>!
diff --git a/vendor/flexi/test/templates/template_tests/foo_with_partial_collection.php b/vendor/flexi/test/templates/template_tests/foo_with_partial_collection.php
deleted file mode 100644
index 3deeeed..0000000
--- a/vendor/flexi/test/templates/template_tests/foo_with_partial_collection.php
+++ /dev/null
@@ -1 +0,0 @@
-[<?= $this->render_partial_collection('item', $items, 'spacer') ?>]
diff --git a/vendor/flexi/test/templates/template_tests/foos_partial.php b/vendor/flexi/test/templates/template_tests/foos_partial.php
deleted file mode 100644
index 8746c07..0000000
--- a/vendor/flexi/test/templates/template_tests/foos_partial.php
+++ /dev/null
@@ -1 +0,0 @@
-<h1><?= $whom ?> at <?= $when ?></h1>
diff --git a/vendor/flexi/test/templates/template_tests/item.php b/vendor/flexi/test/templates/template_tests/item.php
deleted file mode 100644
index 6cf5418..0000000
--- a/vendor/flexi/test/templates/template_tests/item.php
+++ /dev/null
@@ -1 +0,0 @@
-"<?= $item ?>"
diff --git a/vendor/flexi/test/templates/template_tests/layouts/layout.php b/vendor/flexi/test/templates/template_tests/layouts/layout.php
deleted file mode 100644
index 860be85..0000000
--- a/vendor/flexi/test/templates/template_tests/layouts/layout.php
+++ /dev/null
@@ -1 +0,0 @@
-[<?=$content_for_layout?>] \ No newline at end of file
diff --git a/vendor/flexi/test/templates/template_tests/spacer.php b/vendor/flexi/test/templates/template_tests/spacer.php
deleted file mode 100644
index 41622b4..0000000
--- a/vendor/flexi/test/templates/template_tests/spacer.php
+++ /dev/null
@@ -1 +0,0 @@
-, \ No newline at end of file
diff --git a/vendor/flexi/test/varstream.php b/vendor/flexi/test/varstream.php
deleted file mode 100644
index 2dd7c68..0000000
--- a/vendor/flexi/test/varstream.php
+++ /dev/null
@@ -1,244 +0,0 @@
-<?php
-
-class ArrayFileStream {
-
- private $open_file, $position;
-
- private static $fs;
-
- static function set_filesystem(array $fs) {
- ArrayFileStream::$fs = $fs;
- }
-
- private static function &get_element($path) {
- $result =& ArrayFileStream::$fs;
- foreach (preg_split('/\//', $path, -1, PREG_SPLIT_NO_EMPTY) as $element) {
- if (!isset($result[$element])) {
- $null = NULL;
- return $null;
- }
- $result =& $result[$element];
- }
- return $result;
- }
-
- private static function &get_file($path) {
- $url = parse_url($path);
- $file =& self::get_element($url['host'] . $url['path']);
-
- if (is_null($file)) {
- throw new Exception("file not found.");
- }
- return $file;
- }
-
- function stream_close() {
-
- # nothing to do
- }
-
- function stream_flush() {
-
- # nothing to do
- }
-
- function stream_open($path, $mode, $options, $opened_path) {
-
- try {
- $this->open_file =& self::get_file($path);
- $this->position = 0;
- return true;
- } catch (Exception $e) {
- return false;
- }
- }
-
- function stream_read($count) {
-
- $ret = substr($this->open_file, $this->position, $count);
- $this->position += strlen($ret);
- return $ret;
- }
-
- function stream_write($data) {
-
- $left = substr($this->open_file, 0, $this->position);
- $right = substr($this->open_file, $this->position + strlen($data));
- $this->open_file = $left . $data . $right;
- $this->position += strlen($data);
- return strlen($data);
- }
-
- function stream_tell() {
-
- return $this->position;
- }
-
- function stream_eof() {
-
- return $this->position >= strlen($this->open_file);
- }
-
- function stream_seek($offset, $whence) {
-
- switch ($whence) {
- case SEEK_SET:
- if ($offset < strlen($this->open_file) && $offset >= 0) {
- $this->position = $offset;
- return true;
- }
- else {
- return false;
- }
- break;
-
- case SEEK_CUR:
- if ($offset >= 0) {
- $this->position += $offset;
- return true;
- }
- else {
- return false;
- }
- break;
-
- case SEEK_END:
- if (strlen($this->open_file) + $offset >= 0) {
- $this->position = strlen($this->open_file) + $offset;
- return true;
- }
- else {
- return false;
- }
- break;
-
- default:
- return false;
- }
- }
-
- function stream_stat() {
-
- return array('size' => is_array($this->open_file)
- ? sizeof($this->open_file)
- : strlen($this->open_file));
- }
-
- function unlink($path) {
-
- $parent =& self::get_file(dirname($path));
-
- if (is_array($parent) && isset($parent[basename($path)])) {
- unset($parent[basename($path)]);
- return TRUE;
- }
-
- return FALSE;
- }
-
- function rename($path_from, $path_to) {
-
- throw new Exception('not implemented yet');
- }
-
- function mkdir($path, $mode, $options) {
-
- throw new Exception('not implemented yet');
- }
-
- function rmdir($path, $options) {
-
- throw new Exception('not implemented yet');
- }
-
- function dir_opendir($path, $options) {
- try {
- $this->open_file =& self::get_file($path);
- } catch (Exception $e) {
- return FALSE;
- }
-
- return is_array($this->open_file);
- }
-
- function url_stat($path, $flags) {
-
- try {
- $file =& self::get_file($path);
- } catch (Exception $e) {
- return FALSE;
- }
-
- $time = time();
- $keys = array(
- 'dev' => 0,
- 'ino' => 0,
- 'mode' => is_array($file) ? 16832 : 33216, // chmod 700
- 'nlink' => 0,
- 'uid' => function_exists('posix_getuid') ? posix_getuid() : 0,
- 'gid' => function_exists('posix_getgid') ? posix_getgid() : 0,
- 'rdev' => 0,
- 'size' => $flags & STREAM_URL_STAT_QUIET
- ? @strlen($file) : strlen($file),
- 'atime' => $time,
- 'mtime' => $time,
- 'ctime' => $time,
- 'blksize' => 0,
- 'blocks' => 0
- );
- return array_merge(array_values($keys), $keys);
- }
-
- function dir_readdir() {
- if (!is_array($this->open_file)) {
- return FALSE;
- }
- $result = key($this->open_file);
- if ($result === NULL) {
- return FALSE;
- }
- next($this->open_file);
- return $result;
- }
-
- function dir_rewinddir() {
-
- throw new Exception('not implemented yet');
- }
-
- function dir_closedir() {
- reset($this->open_file);
- unset($this->open_file);
- }
-}
-
-
-#ArrayFileStream::set_filesystem(
-# array('tmp' =>
-# array('a' => 'my content',
-# 'b' => '<? echo "hallo welt!";')));
-
-
-#stream_wrapper_register("var", "ArrayFileStream")
-# or die("Failed to register protocol");
-
-#$fp = fopen("var://tmp/a", "rw+");
-
-
-#while (!feof($fp)) {
-# var_dump(fgets($fp));
-#}
-
-#fwrite($fp, "line1\n");
-#fwrite($fp, "line2\n");
-#fwrite($fp, "line3\n");
-
-#rewind($fp);
-
-#var_dump(file_get_contents('var://tmp/a'));
-
-#fclose($fp);
-#unlink('var://tmp/a');
-
-#var_dump(include 'var://tmp/b');
-