Author: caefer
Date: 2010-04-06 22:50:26 +0200 (Tue, 06 Apr 2010)
New Revision: 29022

Added:
   
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestObjectPeer.php
Removed:
   plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestPeer.php
Modified:
   
plugins/sfImageTransformExtraPlugin/trunk/lib/source/sfImageSourcePropel.class.php
   plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestObject.php
   
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/source/sfImageSourcePropelTest.php
Log:
 * finally implemented all but one test for propel



Modified: 
plugins/sfImageTransformExtraPlugin/trunk/lib/source/sfImageSourcePropel.class.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/lib/source/sfImageSourcePropel.class.php
  2010-04-06 20:39:30 UTC (rev 29021)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/lib/source/sfImageSourcePropel.class.php
  2010-04-06 20:50:26 UTC (rev 29022)
@@ -57,7 +57,7 @@
       throw new sfError404Exception('Could not find Propel Peer class for 
"'.$url['host'].'"');
     }
     
-    if(!($obj = call_user_func(array($url['host'], 'retrieveByPk'), 
$url['fragment'])))
+    if(!($obj = call_user_func(array($url['host'].'Peer', 'retrieveByPK'), 
$url['fragment'])))
     {
       throw new sfError404Exception('Could not find "'.$url['host'].'" 
#'.$url['fragment'].'!');
     }

Modified: 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestObject.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestObject.php    
    2010-04-06 20:39:30 UTC (rev 29021)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestObject.php    
    2010-04-06 20:50:26 UTC (rev 29022)
@@ -12,7 +12,7 @@
  */
 
 /* require Peer class */
-require_once(dirname(__FILE__).'/TestPeer.php');
+require_once(dirname(__FILE__).'/TestObjectPeer.php');
 
 /**
  * Mocked Propel record to use in tests

Copied: 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestObjectPeer.php
 (from rev 29020, 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestPeer.php)
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestObjectPeer.php
                            (rev 0)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestObjectPeer.php
    2010-04-06 20:50:26 UTC (rev 29022)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * This file is part of the sfImageTransformExtraPlugin unit tests package.
+ * (c) 2010 Christian Schaefer <[email protected]>>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @package    sfImageTransformExtraPluginUnitTests
+ * @author     Christian Schaefer <[email protected]>
+ * @version    SVN: $Id: sfRawFileCache.class.php 63 2010-03-09 04:34:28Z 
caefer $
+ */
+
+/**
+ * Mocked Propel table to use in tests
+ *
+ * @package    sfImageTransformExtraPluginUnitTests
+ * @subpackage Peer
+ * @author     Christian Schaefer <[email protected]>
+ */
+class TestObjectPeer
+{
+  public static function retrieveByPK($pk)
+  {
+    switch ($pk)
+    {
+      case 1:
+        return new TestObject();
+      default:
+        return null;
+    }
+  }
+}

Deleted: 
plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestPeer.php
===================================================================
--- plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestPeer.php  
2010-04-06 20:39:30 UTC (rev 29021)
+++ plugins/sfImageTransformExtraPlugin/trunk/test/fixtures/model/TestPeer.php  
2010-04-06 20:50:26 UTC (rev 29022)
@@ -1,33 +0,0 @@
-<?php
-/**
- * This file is part of the sfImageTransformExtraPlugin unit tests package.
- * (c) 2010 Christian Schaefer <[email protected]>>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- *
- * @package    sfImageTransformExtraPluginUnitTests
- * @author     Christian Schaefer <[email protected]>
- * @version    SVN: $Id: sfRawFileCache.class.php 63 2010-03-09 04:34:28Z 
caefer $
- */
-
-/**
- * Mocked Propel table to use in tests
- *
- * @package    sfImageTransformExtraPluginUnitTests
- * @subpackage Peer
- * @author     Christian Schaefer <[email protected]>
- */
-class TestPeer
-{
-  public static function retrieveByPK($pk)
-  {
-    switch ($pk)
-    {
-      case 1:
-        return new TestObject();
-      default:
-        return null;
-    }
-  }
-}

Modified: 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/source/sfImageSourcePropelTest.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/source/sfImageSourcePropelTest.php
  2010-04-06 20:39:30 UTC (rev 29021)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/source/sfImageSourcePropelTest.php
  2010-04-06 20:50:26 UTC (rev 29022)
@@ -36,82 +36,70 @@
 
   public function testStream_close()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$fh = fopen($this->testSourceUri, ..');;
-    //$this->assertTrue(is_resource($fh));
-    //fclose($fh);
-    //$this->assertFalse(is_resource($fh));
+    $fh = fopen($this->testSourceUri, 'r');
+    $this->assertTrue(is_resource($fh));
+    fclose($fh);
+    $this->assertFalse(is_resource($fh));
   }
 
   public function testStream_eof()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$fh = fopen($this->testSourceUri, ..');;
-    //$this->assertFalse(feof($fh));
-    //while(!feof($fh))
-    //{
-    //  fgets($fh);
-    //}
-    //$this->assertTrue(feof($fh));
-    //fclose($fh);
+    $fh = fopen($this->testSourceUri, 'r');
+    $this->assertFalse(feof($fh));
+    while(!feof($fh))
+    {
+      fgets($fh);
+    }
+    $this->assertTrue(feof($fh));
+    fclose($fh);
   }
 
   public function testStream_flush()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$fh = fopen($this->testSourceUri, ..');;
-    //$this->assertTrue(fflush($fh));
-    //fclose($fh);
+    $fh = fopen($this->testSourceUri, 'r');
+    $this->assertTrue(fflush($fh));
+    fclose($fh);
   }
 
   public function testStream_open()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$fh = fopen($this->testSourceUri, ..');;
-    //$this->assertTrue(is_resource($fh));
-    //fclose($fh);
+    $fh = fopen($this->testSourceUri, 'r');
+    $this->assertTrue(is_resource($fh));
+    fclose($fh);
   }
 
   public function testStream_read()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$fh = fopen($this->testSourceUri, ..');;
-    //$this->assertEquals(10, strlen(fread($fh, 10)));
-    //fclose($fh);
+    $fh = fopen($this->testSourceUri, 'r');
+    $this->assertEquals(10, strlen(fread($fh, 10)));
+    fclose($fh);
   }
 
   public function testStream_stat()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$fh = fopen($this->testSourceUri, ..');;
-    //$this->assertTrue(is_array(fstat($fh)));
-    //fclose($fh);
+    $fh = fopen($this->testSourceUri, 'r');
+    $this->assertTrue(is_array(fstat($fh)));
+    fclose($fh);
   }
 
   public function testUrl_stat()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$this->assertTrue(is_array(stat($this->testSourceUri)));
+    $this->assertTrue(is_array(stat($this->testSourceUri)));
   }
 
   public function testBuildURIfromParameters()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$this->assertEquals('sfImageSource://TestRecord/file#1', 
sfImageSourcePropel::buildURIfromParameters($this->testParameters));
+    $this->assertEquals('sfImageSource://TestObject/file#1', 
sfImageSourcePropel::buildURIfromParameters($this->testParameters));
   }
 
   protected function setUp()
   {
-    $this->markTestSkipped('No Propel fixture written yet..');
-    //$this->dbh = new Propel_Adapter_Mock('mys..');;
-    //$this->conn = Propel_Manager::getInstance()->openConnection($this->dbh, 
'mysql', true);
+    if(in_array('sfImageSource', stream_get_wrappers()))
+    {
+      stream_wrapper_unregister('sfImageSource');
+    }
+    stream_wrapper_register('sfImageSource', 'sfImageSourcePropel') or 
die('Failed to register protocol..');
 
-    //if(in_array('sfImageSource', stream_get_wrappers()))
-    //{
-    //  stream_wrapper_unregister('sfImageSour..');;
-    //}
-    //stream_wrapper_register('sfImageSource', 'sfImageSourceProp..'); or 
die('Failed to register protocol..');;
-
-    //$this->testSourceUri = 
sfImageSourcePropel::buildURIfromParameters($this->testParameters);
+    $this->testSourceUri = 
sfImageSourcePropel::buildURIfromParameters($this->testParameters);
   }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to