Author: Derick Rethans
Date: 2007-01-19 12:56:59 +0100 (Fri, 19 Jan 2007)
New Revision: 4531

Log:
- Implemented issue #9965: Support for delayed initialization through
  ezcBaseInit.

Added:
   trunk/EventLog/tests/log_delayed_init_test.php
   trunk/EventLog/tests/test_classes.php
Modified:
   trunk/EventLog/ChangeLog
   trunk/EventLog/src/log.php
   trunk/EventLog/tests/suite.php

Modified: trunk/EventLog/ChangeLog
===================================================================
--- trunk/EventLog/ChangeLog    2007-01-19 11:55:49 UTC (rev 4530)
+++ trunk/EventLog/ChangeLog    2007-01-19 11:56:59 UTC (rev 4531)
@@ -1,3 +1,10 @@
+1.1beta1 - [RELEASEDATE]
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- Implemented issue #9965: Support for delayed initialization through
+  ezcBaseInit.
+
+
 1.0.3 - Monday 18 December 2006
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 

Modified: trunk/EventLog/src/log.php
===================================================================
--- trunk/EventLog/src/log.php  2007-01-19 11:55:49 UTC (rev 4530)
+++ trunk/EventLog/src/log.php  2007-01-19 11:56:59 UTC (rev 4531)
@@ -240,6 +240,7 @@
         if ( is_null( self::$instance ) )
         {
             self::$instance = new self();
+            ezcBaseInit::fetchConfig( 'ezcInitLog', self::$instance );
         }
         return self::$instance;
     }

Added: trunk/EventLog/tests/log_delayed_init_test.php
===================================================================
--- trunk/EventLog/tests/log_delayed_init_test.php      2007-01-19 11:55:49 UTC 
(rev 4530)
+++ trunk/EventLog/tests/log_delayed_init_test.php      2007-01-19 11:56:59 UTC 
(rev 4531)
@@ -0,0 +1,37 @@
+<?php
+/**
+ * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ * @version //autogentag//
+ * @filesource
+ * @package Log
+ * @subpackage Tests
+ */
+
+require_once( "test_classes.php" );
+
+/**
+ * @package Log
+ * @subpackage Tests
+ */
+class ezcLogDelayedInitTest extends ezcTestCase
+{
+    private $dbg;
+
+    public function testDelayedInit()
+    {
+        ezcBaseInit::setCallback( 'ezcInitLog', 'testDelayedInitLog' );
+        $log = ezcLog::getInstance();
+        $rule = new ezcLogFilterRule( new ezcLogFilter(), $writer = new 
ezcLogUnixFileWriter( '/' ), true );
+        $expected = new ezcLogFilterSet();
+        $expected->appendRule( $rule );
+        $this->assertAttributeEquals( $expected, 'writers', $log );
+    }
+
+    public static function suite()
+    {
+        return new PHPUnit_Framework_TestSuite("ezcLogDelayedInitTest");
+    }
+}
+
+?>


Property changes on: trunk/EventLog/tests/log_delayed_init_test.php
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/EventLog/tests/suite.php
===================================================================
--- trunk/EventLog/tests/suite.php      2007-01-19 11:55:49 UTC (rev 4530)
+++ trunk/EventLog/tests/suite.php      2007-01-19 11:56:59 UTC (rev 4531)
@@ -8,6 +8,7 @@
  * @subpackage Tests
  */
 
+require_once( "log_delayed_init_test.php");
 require_once( "log_test.php");
 require_once( "log_message_test.php");
 require_once( "mapper/filterset_test.php");
@@ -26,6 +27,7 @@
         parent::__construct();
         $this->setName("EventLog");
         
+        $this->addTest( ezcLogDelayedInitTest::suite() );
         $this->addTest( ezcLogFilterSetTest::suite() );
         $this->addTest( ezcLogContextTest::suite() );
         $this->addTest( ezcLogFileWriterTest::suite() );

Added: trunk/EventLog/tests/test_classes.php
===================================================================
--- trunk/EventLog/tests/test_classes.php       2007-01-19 11:55:49 UTC (rev 
4530)
+++ trunk/EventLog/tests/test_classes.php       2007-01-19 11:56:59 UTC (rev 
4531)
@@ -0,0 +1,9 @@
+<?php
+class testDelayedInitLog
+{
+    static function configureObject( $object )
+    {
+        $object->getMapper()->appendRule( new ezcLogFilterRule( new 
ezcLogFilter(), $writer = new ezcLogUnixFileWriter( '/' ), true) );
+    }
+}
+?>


Property changes on: trunk/EventLog/tests/test_classes.php
___________________________________________________________________
Name: svn:eol-style
   + native

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to