From c3fc1cb7ec91783a7953486c8a83aa8008dd5406 Mon Sep 17 00:00:00 2001 From: Jozef Selesi Date: Thu, 20 Nov 2008 01:25:29 +0000 Subject: * Added HTTP status constants and helper functions to REST helper. * HTTP header setting in comment module now going through REST helper API. * Fixed items controller test. * Fixed user installer test. * Fixed _create() handling in the REST controller. * Fixed routing for edit and add forms. * Added some tests for the REST controller. * Set svn:eol-style to LF on a bunch of files. * Added preamble to MY_Forge.php. --- core/tests/Items_Controller_Test.php | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 core/tests/Items_Controller_Test.php (limited to 'core/tests/Items_Controller_Test.php') diff --git a/core/tests/Items_Controller_Test.php b/core/tests/Items_Controller_Test.php new file mode 100644 index 00000000..784177b5 --- /dev/null +++ b/core/tests/Items_Controller_Test.php @@ -0,0 +1,43 @@ +_update($album); + $this->assert_equal("new title", $album->title); + $this->assert_equal("new description", $album->description); + } + + public function change_item_test_with_return() { + $controller = new Items_Controller(); + $album = album::create(1, "test", "test"); + $_POST["title"] = "item_title"; + $_POST["description"] = "item_description"; + $_POST["__return"] = "item_description"; + + $this->assert_equal("item_description", $controller->_post($album)); + $this->assert_equal("item_title", $album->title); + $this->assert_equal("item_description", $album->description); + } +} -- cgit v1.2.3