Author: kn
Date: Thu Sep 20 14:06:57 2007
New Revision: 6223

Log:
- Added test cases for file backend options

Added:
    trunk/Webdav/tests/backend_file_options_test.php   (with props)
Modified:
    trunk/Webdav/tests/suite.php

Added: trunk/Webdav/tests/backend_file_options_test.php
==============================================================================
--- trunk/Webdav/tests/backend_file_options_test.php (added)
+++ trunk/Webdav/tests/backend_file_options_test.php [iso-8859-1] Thu Sep 20 
14:06:57 2007
@@ -1,0 +1,122 @@
+<?php
+/**
+ * File containing the ezcWebdavFileBackendOptionsTestCase class.
+ * 
+ * @package Webdav
+ * @version //autogen//
+ * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ * @subpackage Test
+ */
+
+require_once dirname( __FILE__ ) . '/property_test.php';
+
+/**
+ * Test case for the ezcWebdavFileBackendOptions class.
+ * 
+ * @package Webdav
+ * @version //autogen//
+ * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ * @subpackage Test
+ */
+class ezcWebdavFileBackendOptionsTestCase extends ezcWebdavPropertyTestCase
+{
+    public static function suite()
+    {
+               return new PHPUnit_Framework_TestSuite( __CLASS__ );
+    }
+
+    protected function setUp()
+    {
+        $this->className = 'ezcWebdavFileBackendOptions';
+        $this->defaultValues = array(
+            'noLock'                => false,
+            'waitForLock'           => 200000,
+            'lockFileName'          => '.ezc_lock',
+            'propertyStoragePath'   => '.ezc',
+            'directoryMode'         => 0755,
+            'fileMode'              => 0644,
+        );
+        $this->workingValues = array(
+            'noLock'                => array(
+                true,
+                false
+            ),
+            'waitForLock'           => array(
+                0,
+                100000
+            ),
+            'lockFileName'          => array(
+                '.foo',
+                'bar'
+            ),
+            'propertyStoragePath'   => array(
+                '.foo',
+                'bar'
+            ),
+            'directoryMode'         => array(
+                0,
+                100
+            ),
+            'fileMode'              => array(
+                0,
+                100
+            ),
+        );
+        $this->failingValues = array(
+            'noLock'                => array(
+                23,
+                23.34,
+                'foo',
+                array(),
+                new stdClass(),
+            ),
+            'waitForLock'           => array(
+                23.34,
+                'foo',
+                array(),
+                false,
+                new stdClass(),
+            ),
+            'lockFileName'          => array(
+                23,
+                23.34,
+                array(),
+                false,
+                new stdClass(),
+            ),
+            'propertyStoragePath'   => array(
+                23,
+                23.34,
+                array(),
+                false,
+                new stdClass(),
+            ),
+            'directoryMode'         => array(
+                23.34,
+                'foo',
+                array(),
+                false,
+                new stdClass(),
+            ),
+            'fileMode'              => array(
+                23.34,
+                'foo',
+                array(),
+                false,
+                new stdClass(),
+            ),
+        );
+    }
+
+    public function testCtorSuccess()
+    {
+        $class = new ReflectionClass( $this->className );
+        $object = $class->newInstance();
+
+        $this->assertPropertyValues( $object, $this->defaultValues );
+    }
+}
+
+?>

Propchange: trunk/Webdav/tests/backend_file_options_test.php
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/Webdav/tests/suite.php
==============================================================================
--- trunk/Webdav/tests/suite.php [iso-8859-1] (original)
+++ trunk/Webdav/tests/suite.php [iso-8859-1] Thu Sep 20 14:06:57 2007
@@ -22,6 +22,7 @@
  */
 require_once 'backend_memory_test.php';
 require_once 'backend_file_test.php';
+require_once 'backend_file_options_test.php';
 
 require_once 'path_factory_automatic_test.php';
 
@@ -117,6 +118,7 @@
 
         $this->addTest( ezcWebdavMemoryBackendTest::suite() );
         $this->addTest( ezcWebdavFileBackendTest::suite() );
+        $this->addTest( ezcWebdavFileBackendOptionsTestCase::suite() );
 
         $this->addTest( ezcWebdavAutomaticPathFactoryTest::suite() );
 


-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to