Browse Source

Zend_Serializer tests: coding standards + files comments + class comments

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20576 44c647ce-9c0f-0410-b52a-842ac1e357ba
mabe 16 years ago
parent
commit
1597a965be

+ 57 - 10
tests/Zend/Serializer/Adapter/AllTests.php

@@ -1,4 +1,24 @@
 <?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
+ * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
+ */
 
 /**
  * Test helper
@@ -9,36 +29,63 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Zend_Serializer_Adapter_AllTests::main');
 }
 
-/** @see Zend_Serializer_Adapter_PhpSerializeTest */
+/**
+ * @see Zend_Serializer_Adapter_PhpSerializeTest
+ */
 require_once dirname(__FILE__) . '/PhpSerializeTest.php';
 
-/** @see Zend_Serializer_Adapter_PhpCodeTest */
+/**
+ * @see Zend_Serializer_Adapter_PhpCodeTest
+ */
 require_once dirname(__FILE__) . '/PhpCodeTest.php';
 
-/** @see Zend_Serializer_Adapter_JsonTest */
+/**
+ * @see Zend_Serializer_Adapter_JsonTest
+ */
 require_once dirname(__FILE__) . '/JsonTest.php';
 
-/** @see Zend_Serializer_Adapter_Amf0Test */
+/**
+ * @see Zend_Serializer_Adapter_Amf0Test
+ */
 require_once dirname(__FILE__) . '/Amf0Test.php';
 
-/** @see Zend_Serializer_Adapter_Amf3Test */
+/**
+ * @see Zend_Serializer_Adapter_Amf3Test
+ */
 require_once dirname(__FILE__) . '/Amf3Test.php';
 
-/** @see Zend_Serializer_Adapter_WddxTest */
+/**
+ * @see Zend_Serializer_Adapter_WddxTest
+ */
 require_once dirname(__FILE__) . '/WddxTest.php';
 
-/** @see Zend_Serializer_Adapter_IgbinaryTest */
+/**
+ * @see Zend_Serializer_Adapter_IgbinaryTest
+ */
 require_once dirname(__FILE__) . '/IgbinaryTest.php';
 
-/** @see Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test */
+/**
+ * @see Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test
+ */
 require_once dirname(__FILE__) . '/PythonPickleSerializeProtocol0Test.php';
 
-/** @see Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test */
+/**
+ * @see Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test
+ */
 require_once dirname(__FILE__) . '/PythonPickleSerializeProtocol1Test.php';
 
-/** @see Zend_Serializer_Adapter_PythonPickleUnserializeTest */
+/**
+ * @see Zend_Serializer_Adapter_PythonPickleUnserializeTest
+ */
 require_once dirname(__FILE__) . '/PythonPickleUnserializeTest.php';
 
+/**
+ * @category   Zend
+ * @package    Zend_Serializer
+ * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ */
 class Zend_Serializer_Adapter_AllTests
 {
     public static function main()

+ 27 - 4
tests/Zend/Serializer/Adapter/Amf0Test.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_Amf0 */
+/**
+ * @see Zend_Serializer_Adapter_Amf0
+ */
 require_once 'Zend/Serializer/Adapter/Amf0.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/Amf0.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_Amf0Test extends PHPUnit_Framework_TestCase
 {
@@ -35,7 +56,8 @@ class Zend_Serializer_Adapter_Amf0Test extends PHPUnit_Framework_TestCase
      * Simple test to serialize a value using Zend_Amf_Parser_Amf0_Serializer
      * -> This only tests the usage of Zend_Amf @see Zend_Amf_AllTests
      */
-    public function testSerialize() {
+    public function testSerialize()
+    {
         $value    = true;
         $expected = "\x01\x01"; // Amf0 -> true
 
@@ -47,7 +69,8 @@ class Zend_Serializer_Adapter_Amf0Test extends PHPUnit_Framework_TestCase
      * Simple test to serialize a value using Zend_Amf_Parser_Amf0_Deserializer
      * -> This only tests the usage of Zend_Amf @see Zend_Amf_AllTests
      */
-    public function testUnserialize() {
+    public function testUnserialize()
+    {
         $expected   = true;
         $value      = "\x01\x01"; // Amf0 -> true
 

+ 27 - 4
tests/Zend/Serializer/Adapter/Amf3Test.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_Amf3 */
+/**
+ * @see Zend_Serializer_Adapter_Amf3
+ */
 require_once 'Zend/Serializer/Adapter/Amf3.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/Amf3.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_Amf3Test extends PHPUnit_Framework_TestCase
 {
@@ -35,7 +56,8 @@ class Zend_Serializer_Adapter_Amf3Test extends PHPUnit_Framework_TestCase
      * Simple test to serialize a value using Zend_Amf_Parser_Amf3_Serializer
      * -> This only tests the usage of Zend_Amf @see Zend_Amf_AllTests
      */
-    public function testSerialize() {
+    public function testSerialize()
+    {
         $value    = true;
         $expected = "\x03"; // Amf3 -> true
 
@@ -47,7 +69,8 @@ class Zend_Serializer_Adapter_Amf3Test extends PHPUnit_Framework_TestCase
      * Simple test to unserialize a value using Zend_Amf_Parser_Amf3_Deserializer
      * -> This only tests the usage of Zend_Amf @see Zend_Amf_AllTests
      */
-    public function testUnserialize() {
+    public function testUnserialize()
+    {
         $expected   = true;
         $value      = "\x03"; // Amf3 -> true
 

+ 45 - 13
tests/Zend/Serializer/Adapter/IgbinaryTest.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_Igbinary */
+/**
+ * @see Zend_Serializer_Adapter_Igbinary
+ */
 require_once 'Zend/Serializer/Adapter/Igbinary.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/Igbinary.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
 {
@@ -31,7 +52,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->_adapter = null;
     }
 
-    public function testSerializeString() {
+    public function testSerializeString()
+    {
         $value    = 'test';
         $expected = igbinary_serialize($value);
 
@@ -39,7 +61,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeFalse() {
+    public function testSerializeFalse()
+    {
         $value    = false;
         $expected = igbinary_serialize($value);
 
@@ -47,7 +70,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNull() {
+    public function testSerializeNull()
+    {
         $value    = null;
         $expected = igbinary_serialize($value);
 
@@ -55,7 +79,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNumeric() {
+    public function testSerializeNumeric()
+    {
         $value    = 100;
         $expected = igbinary_serialize($value);
 
@@ -63,7 +88,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeObject() {
+    public function testSerializeObject()
+    {
         $value    = new stdClass();
         $expected = igbinary_serialize($value);
 
@@ -71,7 +97,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeString() {
+    public function testUnserializeString()
+    {
         $expected = 'test';
         $value    = igbinary_serialize($expected);
 
@@ -79,7 +106,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeFalse() {
+    public function testUnserializeFalse()
+    {
         $expected = false;
         $value    = igbinary_serialize($expected);
 
@@ -87,7 +115,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNull() {
+    public function testUnserializeNull()
+    {
         $expected = null;
         $value    = igbinary_serialize($expected);
 
@@ -95,7 +124,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNumeric() {
+    public function testUnserializeNumeric()
+    {
         $expected = 100;
         $value    = igbinary_serialize($expected);
 
@@ -103,7 +133,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeObject() {
+    public function testUnserializeObject()
+    {
         $expected = new stdClass();
         $value    = igbinary_serialize($expected);
 
@@ -111,7 +142,8 @@ class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserialzeInvalid() {
+    public function testUnserialzeInvalid()
+    {
         $value = "\0\1\r\n";
         $this->setExpectedException('Zend_Serializer_Exception');
         $this->_adapter->unserialize($value);

+ 45 - 13
tests/Zend/Serializer/Adapter/JsonTest.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_Json */
+/**
+ * @see Zend_Serializer_Adapter_Json
+ */
 require_once 'Zend/Serializer/Adapter/Json.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/Json.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
 {
@@ -31,7 +52,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->_adapter = null;
     }
 
-    public function testSerializeString() {
+    public function testSerializeString()
+    {
         $value    = 'test';
         $expected = '"test"';
 
@@ -39,7 +61,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeFalse() {
+    public function testSerializeFalse()
+    {
         $value    = false;
         $expected = 'false';
 
@@ -47,7 +70,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNull() {
+    public function testSerializeNull()
+    {
         $value    = null;
         $expected = 'null';
 
@@ -55,7 +79,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNumeric() {
+    public function testSerializeNumeric()
+    {
         $value    = 100;
         $expected = '100';
 
@@ -63,7 +88,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeObject() {
+    public function testSerializeObject()
+    {
         $value       = new stdClass();
         $value->test = "test";
         $expected    = '{"test":"test"}';
@@ -72,7 +98,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeString() {
+    public function testUnserializeString()
+    {
         $value    = '"test"';
         $expected = 'test';
 
@@ -80,7 +107,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeFalse() {
+    public function testUnserializeFalse()
+    {
         $value    = 'false';
         $expected = false;
 
@@ -96,7 +124,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNumeric() {
+    public function testUnserializeNumeric()
+    {
         $value    = '100';
         $expected = 100;
 
@@ -104,7 +133,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeAsArray() {
+    public function testUnserializeAsArray()
+    {
         $value    = '{"test":"test"}';
         $expected = array('test' => 'test');
 
@@ -112,7 +142,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeAsObject() {
+    public function testUnserializeAsObject()
+    {
         $value      = '{"test":"test"}';
         $expected   = new stdClass();
         $expected->test = 'test';
@@ -121,7 +152,8 @@ class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserialzeInvalid() {
+    public function testUnserialzeInvalid()
+    {
         $value = 'not a serialized string';
         $this->setExpectedException('Zend_Serializer_Exception');
         $this->_adapter->unserialize($value);

+ 45 - 13
tests/Zend/Serializer/Adapter/PhpCodeTest.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_PhpCode */
+/**
+ * @see Zend_Serializer_Adapter_PhpCode
+ */
 require_once 'Zend/Serializer/Adapter/PhpCode.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/PhpCode.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
 {
@@ -31,7 +52,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->_adapter = null;
     }
 
-    public function testSerializeString() {
+    public function testSerializeString()
+    {
         $value      = 'test';
         $expected   = "'test'";
 
@@ -39,7 +61,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeFalse() {
+    public function testSerializeFalse()
+    {
         $value    = false;
         $expected = 'false';
 
@@ -47,7 +70,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNull() {
+    public function testSerializeNull()
+    {
         $value    = null;
         $expected = 'NULL';
 
@@ -55,7 +79,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNumeric() {
+    public function testSerializeNumeric()
+    {
         $value    = 100.12345;
         $expected = '100.12345';
 
@@ -63,7 +88,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeObject() {
+    public function testSerializeObject()
+    {
         $value    = new stdClass();
         $expected = "stdClass::__set_state(array(\n))";
 
@@ -71,7 +97,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeString() {
+    public function testUnserializeString()
+    {
         $value    = "'test'";
         $expected = 'test';
 
@@ -79,7 +106,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeFalse() {
+    public function testUnserializeFalse()
+    {
         $value    = 'false';
         $expected = false;
 
@@ -87,7 +115,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNull() {
+    public function testUnserializeNull()
+    {
         $value    = 'NULL';
         $expected = null;
 
@@ -95,7 +124,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNumeric() {
+    public function testUnserializeNumeric()
+    {
         $value    = '100';
         $expected = 100;
 
@@ -104,7 +134,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
     }
 
 /* TODO: PHP Fatal error:  Call to undefined method stdClass::__set_state()
-    public function testUnserializeObject() {
+    public function testUnserializeObject()
+    {
         $value    = "stdClass::__set_state(array(\n))";
         $expected = new stdClass();
 
@@ -113,7 +144,8 @@ class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase
     }
 */
 
-    public function testUnserialzeInvalid() {
+    public function testUnserialzeInvalid()
+    {
         $value = 'not a serialized string';
         $this->setExpectedException('Zend_Serializer_Exception');
         $this->_adapter->unserialize($value);

+ 45 - 13
tests/Zend/Serializer/Adapter/PhpSerializeTest.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_PhpSerialize */
+/**
+ * @see Zend_Serializer_Adapter_PhpSerialize
+ */
 require_once 'Zend/Serializer/Adapter/PhpSerialize.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/PhpSerialize.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCase
 {
@@ -31,7 +52,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->_adapter = null;
     }
 
-    public function testSerializeString() {
+    public function testSerializeString()
+    {
         $value      = 'test';
         $expected   = 's:4:"test";';
 
@@ -39,7 +61,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeFalse() {
+    public function testSerializeFalse()
+    {
         $value    = false;
         $expected = 'b:0;';
 
@@ -47,7 +70,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNull() {
+    public function testSerializeNull()
+    {
         $value    = null;
         $expected = 'N;';
 
@@ -55,7 +79,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNumeric() {
+    public function testSerializeNumeric()
+    {
         $value    = 100;
         $expected = 'i:100;';
 
@@ -63,7 +88,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeObject() {
+    public function testSerializeObject()
+    {
         $value    = new stdClass();
         $expected = 'O:8:"stdClass":0:{}';
 
@@ -71,7 +97,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeString() {
+    public function testUnserializeString()
+    {
         $value    = 's:4:"test";';
         $expected = 'test';
 
@@ -79,7 +106,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeFalse() {
+    public function testUnserializeFalse()
+    {
         $value    = 'b:0;';
         $expected = false;
 
@@ -87,7 +115,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNull() {
+    public function testUnserializeNull()
+    {
         $value    = 'N;';
         $expected = null;
 
@@ -95,7 +124,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNumeric() {
+    public function testUnserializeNumeric()
+    {
         $value    = 'i:100;';
         $expected = 100;
 
@@ -103,7 +133,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeObject() {
+    public function testUnserializeObject()
+    {
         $value    = 'O:8:"stdClass":0:{}';
         $expected = new stdClass();
 
@@ -111,7 +142,8 @@ class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCas
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserialzeInvalid() {
+    public function testUnserialzeInvalid()
+    {
         $value = 'not a serialized string';
         $this->setExpectedException('Zend_Serializer_Exception');
         $this->_adapter->unserialize($value);

+ 43 - 12
tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol0Test.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_PythonPickle */
+/**
+ * @see Zend_Serializer_Adapter_PythonPickle
+ */
 require_once 'Zend/Serializer/Adapter/PythonPickle.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/PythonPickle.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit_Framework_TestCase
 {
@@ -31,7 +52,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->_adapter = null;
     }
 
-    public function testSerializeNull() {
+    public function testSerializeNull()
+    {
         $value      = null;
         $expected   = 'N.';
 
@@ -39,7 +61,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeTrue() {
+    public function testSerializeTrue()
+    {
         $value      = true;
         $expected   = "I01\r\n.";
 
@@ -47,7 +70,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeFalse() {
+    public function testSerializeFalse()
+    {
         $value      = false;
         $expected   = "I00\r\n.";
 
@@ -55,7 +79,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeInt() {
+    public function testSerializeInt()
+    {
         $value      = -12345;
         $expected   = "I-12345\r\n.";
 
@@ -63,7 +88,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeFloat() {
+    public function testSerializeFloat()
+    {
         $value      = -12345.6789;
         $expected   = "F-12345.6789\r\n.";
 
@@ -71,7 +97,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeString() {
+    public function testSerializeString()
+    {
         $value      = 'test';
         $expected   = "S'test'\r\np0\r\n.";
 
@@ -79,7 +106,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeStringWithSpecialChars() {
+    public function testSerializeStringWithSpecialChars()
+    {
         $value      = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
                     . "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
                     . "\xff\\\"'";
@@ -92,7 +120,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeArrayList() {
+    public function testSerializeArrayList()
+    {
         $value      = array('1', '2', 'test');
         $expected   = "(lp0\r\n"
                     . "S'1'\r\n"
@@ -107,7 +136,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeArrayDict() {
+    public function testSerializeArrayDict()
+    {
         $value    = array('1', '2', 'three' => 'test');
         $expected = "(dp0\r\n"
                   . "I0\r\n"
@@ -126,7 +156,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeObject() {
+    public function testSerializeObject()
+    {
         $value = new StdClass();
         $value->test  = 'test';
         $value->test2 = 2;

+ 41 - 11
tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol1Test.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_PythonPickle */
+/**
+ * @see Zend_Serializer_Adapter_PythonPickle
+ */
 require_once 'Zend/Serializer/Adapter/PythonPickle.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/PythonPickle.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit_Framework_TestCase
 {
@@ -31,7 +52,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->_adapter = null;
     }
 
-    public function testSerializeNull() {
+    public function testSerializeNull()
+   {
         $value    = null;
         $expected = 'N.';
 
@@ -39,7 +61,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeTrue() {
+    public function testSerializeTrue()
+    {
         $value    = true;
         $expected = "I01\r\n.";
 
@@ -47,7 +70,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeFalse() {
+    public function testSerializeFalse()
+    {
         $value    = false;
         $expected = "I00\r\n.";
 
@@ -55,7 +79,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeBinInt1() {
+    public function testSerializeBinInt1()
+    {
         $value    = 255;
         $expected = "K\xff.";
 
@@ -63,7 +88,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeBinInt2() {
+    public function testSerializeBinInt2()
+    {
         $value    = 256;
         $expected = "M\x00\x01.";
 
@@ -71,7 +97,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeBinInt() {
+    public function testSerializeBinInt()
+    {
         $value    = -2;
         $expected = "J\xfe\xff\xff\xff.";
 
@@ -79,7 +106,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeBinFloat() {
+    public function testSerializeBinFloat()
+    {
         $value    = -12345.6789;
         $expected = "G\xc0\xc8\x1c\xd6\xe6\x31\xf8\xa1.";
 
@@ -87,7 +115,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeShortBinString() {
+    public function testSerializeShortBinString()
+    {
         $value    = 'test';
         $expected = "U\x04test"
                   . "q\x00.";
@@ -96,7 +125,8 @@ class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeBinString() {
+    public function testSerializeBinString()
+    {
         $value    = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
                   . "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
                   . "01234567890123456789012345678901234567890123456789012345";

+ 87 - 34
tests/Zend/Serializer/Adapter/PythonPickleUnserializeTest.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_PythonPickle */
+/**
+ * @see Zend_Serializer_Adapter_PythonPickle
+ */
 require_once 'Zend/Serializer/Adapter/PythonPickle.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/PythonPickle.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framework_TestCase
 {
@@ -31,7 +52,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->_adapter = null;
     }
 
-    public function testUnserializeNone() {
+    public function testUnserializeNone()
+    {
         $value    = "N.";
         $expected = null;
 
@@ -39,7 +61,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNewTrue() {
+    public function testUnserializeNewTrue()
+    {
         $value    = "\x80\x02\x88.";
         $expected = true;
 
@@ -47,7 +70,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNewFalse() {
+    public function testUnserializeNewFalse()
+    {
         $value    = "\x80\x02\x89.";
         $expected = false;
 
@@ -55,7 +79,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeIntTrue() {
+    public function testUnserializeIntTrue()
+    {
         $value    = "I01\r\n.";
         $expected = true;
 
@@ -63,7 +88,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeIntFalse() {
+    public function testUnserializeIntFalse()
+    {
         $value    = "I00\r\n.";
         $expected = false;
 
@@ -71,7 +97,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeInt() {
+    public function testUnserializeInt()
+    {
         $value    = "I1\r\n.";
         $expected = 1;
 
@@ -79,7 +106,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeBinInt() {
+    public function testUnserializeBinInt()
+    {
         $value    = "\x80\x02J\xc7\xcf\xff\xff.";
         $expected = -12345;
 
@@ -87,7 +115,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeBinInt1() {
+    public function testUnserializeBinInt1()
+    {
         $value    = "\x80\x02K\x02.";
         $expected = 2;
 
@@ -95,7 +124,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeBinInt2() {
+    public function testUnserializeBinInt2()
+    {
         $value    = "\x80\x02M\x00\x01.";
         $expected = 256;
 
@@ -103,7 +133,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeLong() {
+    public function testUnserializeLong()
+    {
         $value    = "L9876543210L\r\n.";
         $expected = '9876543210';
 
@@ -111,7 +142,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeLong1() {
+    public function testUnserializeLong1()
+    {
         $value    = "\x80\x02\x8a\x05\xea\x16\xb0\x4c\x02.";
         $expected = '9876543210';
 
@@ -119,7 +151,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeLong4Positiv() {
+    public function testUnserializeLong4Positiv()
+    {
         $value    = "\x80\x02\x8b\x07\x00\x00\x00"
                   . str_pad("\xff", 7, "\x7f")
                   . ".";
@@ -129,7 +162,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeLong4Negativ() {
+    public function testUnserializeLong4Negativ()
+    {
         $value    = "\x80\x02\x8b\x07\x00\x00\x00"
                   . str_pad("\x00", 7, "\x9f")
                   . ".";
@@ -139,7 +173,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeLong4InfBcMath() {
+    public function testUnserializeLong4InfBcMath()
+    {
         $value    = "\x80\x02\x8b\x08\x00\x00\x00"
                   . str_pad("\x00", 8, "\x9f")
                   . ".";
@@ -153,7 +188,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeFloat() {
+    public function testUnserializeFloat()
+    {
         $value    = "F-12345.6789\r\n.";
         $expected = -12345.6789;
 
@@ -161,7 +197,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeBinFloat() {
+    public function testUnserializeBinFloat()
+    {
         $value    = "\x80\x02G\xc0\xc8\x1c\xd6\xe6\x31\xf8\xa1.";
         $expected = -12345.6789;
 
@@ -169,7 +206,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeString() {
+    public function testUnserializeString()
+    {
         $value    = "S'test'\r\np0\r\n.";
         $expected = 'test';
 
@@ -177,7 +215,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeStringDoubleQuotes() {
+    public function testUnserializeStringDoubleQuotes()
+    {
         $value    = "S\"'t'e's't'\"\r\np0\r\n.";
         $expected = "'t'e's't'";
 
@@ -185,7 +224,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeStringWithSpecialChars() {
+    public function testUnserializeStringWithSpecialChars()
+    {
         $value    = "S'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f"
                   . "\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f"
                   . "\\xff\\\\\"\\''\r\n"
@@ -198,7 +238,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeBinString() {
+    public function testUnserializeBinString()
+    {
         $value    = "\x80\x02T\x00\x01\x00\x00"
                   . "01234567890123456789012345678901234567890123456789"
                   . "01234567890123456789012345678901234567890123456789"
@@ -216,7 +257,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeShortBinString() {
+    public function testUnserializeShortBinString()
+    {
         $value    = "\x80\x02U\x04"
                   . "test"
                   . "q\x00.";
@@ -226,7 +268,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeUnicode() {
+    public function testUnserializeUnicode()
+    {
         $value    = "Vtest\\u0400\r\n" // test + ` + E
                   . "p0\r\n"
                   . ".";
@@ -236,7 +279,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeBinUnicode() {
+    public function testUnserializeBinUnicode()
+    {
         $value    = "\x80\x02" . "X\x07\x00\x00\x00" . "test\xd0\x80\n.";
         $expected = "test\xd0\x80\n"; // test + ` + E + \n
 
@@ -244,7 +288,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeListAppend() {
+    public function testUnserializeListAppend()
+    {
         $value = "(lp0\r\n"
                . "I1\r\n"
                . "aI2\r\n"
@@ -256,7 +301,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeEmptyListAppends() {
+    public function testUnserializeEmptyListAppends()
+    {
         $value    = "\x80\x02]q\x00(K\x01K\x02K\x03e.";
         $expected = array(1,2,3);
 
@@ -264,7 +310,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeDictSetItem() {
+    public function testUnserializeDictSetItem()
+    {
         $value = "(dp0\r\n"
                . "S'test1'\r\n"
                . "p1\r\n"
@@ -281,7 +328,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeEmptyDictSetItems() {
+    public function testUnserializeEmptyDictSetItems()
+    {
         $value    = "\x80\x02}q\x00(U\x05test1q\x01K\x01K\x00K\x02U\x05test3q\x02h\x02u.";
         $expected = array('test1' => 1, 0 => 2, 'test3' => 'test3');
 
@@ -289,7 +337,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeTuple() {
+    public function testUnserializeTuple()
+    {
         $value    = "(I1\r\n"
                   . "I2\r\n"
                   . "I3\r\n"
@@ -301,7 +350,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeTuple1() {
+    public function testUnserializeTuple1()
+    {
         $value    = "\x80\x02K\x01\x85q\x00.";
         $expected = array(1);
 
@@ -309,7 +359,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeTuple2() {
+    public function testUnserializeTuple2()
+    {
         $value    = "\x80\x02K\x01K\x02\x86q\x00.";
         $expected = array(1,2);
 
@@ -317,7 +368,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeTuple3() {
+    public function testUnserializeTuple3()
+    {
         $value    = "\x80\x02K\x01K\x02K\x03\x87q\x00.";
         $expected = array(1,2,3);
 
@@ -325,7 +377,8 @@ class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framew
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserialzeInvalid() {
+    public function testUnserialzeInvalid()
+    {
         $value = 'not a serialized string';
         $this->setExpectedException('Zend_Serializer_Exception');
         $this->_adapter->unserialize($value);

+ 53 - 17
tests/Zend/Serializer/Adapter/WddxTest.php

@@ -1,10 +1,28 @@
 <?php
 /**
- * @package    Zend_Cache
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
-/** @see Zend_Serializer_Adapter_Wddx */
+/**
+ * @see Zend_Serializer_Adapter_Wddx
+ */
 require_once 'Zend/Serializer/Adapter/Wddx.php';
 
 /**
@@ -13,8 +31,11 @@ require_once 'Zend/Serializer/Adapter/Wddx.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
 {
@@ -31,7 +52,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->_adapter = null;
     }
 
-    public function testSerializeString() {
+    public function testSerializeString()
+    {
         $value    = 'test';
         $expected = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><string>test</string></data></wddxPacket>';
@@ -40,7 +62,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeStringWithComment() {
+    public function testSerializeStringWithComment()
+    {
         $value    = 'test';
         $expected = '<wddxPacket version=\'1.0\'><header><comment>a test comment</comment></header>'
                   . '<data><string>test</string></data></wddxPacket>';
@@ -49,7 +72,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeFalse() {
+    public function testSerializeFalse()
+    {
         $value    = false;
         $expected = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><boolean value=\'false\'/></data></wddxPacket>';
@@ -58,7 +82,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeTrue() {
+    public function testSerializeTrue()
+    {
         $value    = true;
         $expected = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><boolean value=\'true\'/></data></wddxPacket>';
@@ -67,7 +92,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNull() {
+    public function testSerializeNull()
+    {
         $value    = null;
         $expected = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><null/></data></wddxPacket>';
@@ -76,7 +102,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeNumeric() {
+    public function testSerializeNumeric()
+    {
         $value    = 100;
         $expected = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><number>100</number></data></wddxPacket>';
@@ -85,7 +112,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testSerializeObject() {
+    public function testSerializeObject()
+    {
         $value = new stdClass();
         $value->test = "test";
         $expected = '<wddxPacket version=\'1.0\'><header/>'
@@ -98,7 +126,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeString() {
+    public function testUnserializeString()
+    {
         $value    = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><string>test</string></data></wddxPacket>';
         $expected = 'test';
@@ -107,7 +136,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeFalse() {
+    public function testUnserializeFalse()
+    {
         $value    = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><boolean value=\'false\'/></data></wddxPacket>';
         $expected = false;
@@ -116,7 +146,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeTrue() {
+    public function testUnserializeTrue()
+    {
         $value    = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><boolean value=\'true\'/></data></wddxPacket>';
         $expected = true;
@@ -125,7 +156,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNull1() {
+    public function testUnserializeNull1()
+    {
         $value    = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><null/></data></wddxPacket>';
         $expected = null;
@@ -139,7 +171,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
      * but with some differenzes to the null cenerated by php
      * -> the invalid check have to success for all valid wddx null
      */
-    public function testUnserializeNull2() {
+    public function testUnserializeNull2()
+    {
         $value    = '<wddxPacket version=\'1.0\'><header/>' . "\n"
                   . '<data><null/></data></wddxPacket>';
         $expected = null;
@@ -148,7 +181,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeNumeric() {
+    public function testUnserializeNumeric()
+    {
         $value    = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><number>100</number></data></wddxPacket>';
         $expected = 100;
@@ -157,7 +191,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserializeObject() {
+    public function testUnserializeObject()
+    {
         $value    = '<wddxPacket version=\'1.0\'><header/>'
                   . '<data><struct>'
                   . '<var name=\'php_class_name\'><string>stdClass</string></var>'
@@ -170,7 +205,8 @@ class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $data);
     }
 
-    public function testUnserialzeInvalid() {
+    public function testUnserialzeInvalid()
+    {
         $value = 'not a serialized string';
         $this->setExpectedException('Zend_Serializer_Exception');
         $this->_adapter->unserialize($value);

+ 77 - 45
tests/Zend/Serializer/AllTests.php

@@ -1,45 +1,77 @@
-<?php
-
-/**
- * Test helper
- */
-require_once dirname(__FILE__) . '/../../TestHelper.php';
-
-if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Zend_Serializer_AllTests::main');
-}
-
-/** @see Zend_Serializer_Adapter_AllTests */
-require_once dirname(__FILE__) . '/Adapter/AllTests.php';
-
-/** @see Zend_Serializer_SerializerTest */
-require_once dirname(__FILE__) . '/SerializerTest.php';
-
-class Zend_Serializer_AllTests
-{
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Zend');
-
-        /*
-         * Performe Zend_Serializer_Adapter tests
-         */
-        $suite->addTest(Zend_Serializer_Adapter_AllTests::suite());
-
-        /**
-         * Performe Zend_Serializer tests
-         */
-        $suite->addTestSuite('Zend_Serializer_SerializerTest');
-
-        return $suite;
-    }
-}
-
-if (PHPUnit_MAIN_METHOD == 'Zend_Serializer_AllTests::main') {
-    Zend_Serializer_AllTests::main();
-}
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
+ * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
+ */
+
+/**
+ * Test helper
+ */
+require_once dirname(__FILE__) . '/../../TestHelper.php';
+
+if (!defined('PHPUnit_MAIN_METHOD')) {
+    define('PHPUnit_MAIN_METHOD', 'Zend_Serializer_AllTests::main');
+}
+
+/**
+ * @see Zend_Serializer_Adapter_AllTests
+ */
+require_once dirname(__FILE__) . '/Adapter/AllTests.php';
+
+/**
+ * @see Zend_Serializer_SerializerTest
+ */
+require_once dirname(__FILE__) . '/SerializerTest.php';
+
+/**
+ * @category   Zend
+ * @package    Zend_Serializer
+ * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ */
+class Zend_Serializer_AllTests
+{
+    public static function main()
+    {
+        PHPUnit_TextUI_TestRunner::run(self::suite());
+    }
+
+    public static function suite()
+    {
+        $suite = new PHPUnit_Framework_TestSuite('Zend');
+
+        /**
+         * Performe Zend_Serializer_Adapter tests
+         */
+        $suite->addTest(Zend_Serializer_Adapter_AllTests::suite());
+
+        /**
+         * Performe Zend_Serializer tests
+         */
+        $suite->addTestSuite('Zend_Serializer_SerializerTest');
+
+        return $suite;
+    }
+
+}
+
+if (PHPUnit_MAIN_METHOD == 'Zend_Serializer_AllTests::main') {
+    Zend_Serializer_AllTests::main();
+}

+ 20 - 1
tests/Zend/Serializer/SerializerTest.php

@@ -1,7 +1,23 @@
 <?php
 /**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
  */
 
 /**
@@ -15,8 +31,11 @@ require_once 'Zend/Serializer.php';
 require_once 'PHPUnit/Framework/TestCase.php';
 
 /**
+ * @category   Zend
  * @package    Zend_Serializer
  * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Serializer_SerializerTest extends PHPUnit_Framework_TestCase
 {
@@ -57,7 +76,7 @@ class Zend_Serializer_SerializerTest extends PHPUnit_Framework_TestCase
     public function testFactoryOnADummyClassAdapter()
     {
         $this->setExpectedException('Zend_Serializer_Exception','must implement Zend_Serializer_Adapter_AdapterInterface');
-        Zend_Serializer::setAdapterLoader(new Zend_Loader_PluginLoader(array('Zend_Serializer_Adapter' => dirname(__FILE__).'/_files')));
+        Zend_Serializer::setAdapterLoader(new Zend_Loader_PluginLoader(array('Zend_Serializer_Adapter' => dirname(__FILE__) . '/_files')));
         Zend_Serializer::factory('dummy');
     }
 

+ 30 - 1
tests/Zend/Serializer/_files/Dummy.php

@@ -1,2 +1,31 @@
 <?php
-class Zend_Serializer_Adapter_Dummy { }
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Serializer
+ * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
+ */
+
+/**
+ * @category   Zend
+ * @package    Zend_Serializer
+ * @subpackage UnitTests
+ * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ */
+class Zend_Serializer_Adapter_Dummy
+{}