Author: caefer
Date: 2010-03-22 14:07:03 +0100 (Mon, 22 Mar 2010)
New Revision: 28671
Added:
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/source/sfImageSourcePropelTest.php
Log:
added TestCase for Propel source (still empty)
Added:
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/source/sfImageSourcePropelTest.php
===================================================================
---
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/source/sfImageSourcePropelTest.php
(rev 0)
+++
plugins/sfImageTransformExtraPlugin/trunk/test/unit/lib/source/sfImageSourcePropelTest.php
2010-03-22 13:07:03 UTC (rev 28671)
@@ -0,0 +1,117 @@
+<?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 $
+ */
+
+/** central bootstrap for unit tests */
+require_once dirname(__FILE__).'/../../../bootstrap/unit.php';
+/** Propel test record for mocking */
+require_once dirname(__FILE__).'/../../../bootstrap/TestRecord.php';
+/** PHPUnit Framework */
+require_once 'PHPUnit/Framework.php';
+
+/**
+ * PHPUnit test for sfImageSourcePropel transformation
+ *
+ * @package sfImageTransformExtraPluginUnitTests
+ * @subpackage source
+ * @author Christian Schaefer <[email protected]>
+ */
+class sfImageSourcePropelTest extends PHPUnit_Framework_TestCase
+{
+ private $testSourceUri = null;
+ private $testParameters = array(
+ 'type' => 'TestRecord',
+ 'attribute' => 'file',
+ 'id' => '1'
+ );
+
+ public function testStream_close()
+ {
+ $this->markTestSkipped('No Propel fixture written yet..')
+ //$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, '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, 'r');
+ //$this->assertTrue(fflush($fh));
+ //fclose($fh);
+ }
+
+ public function testStream_open()
+ {
+ $this->markTestSkipped('No Propel fixture written yet..')
+ //$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, '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, '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)));
+ }
+
+ public function testBuildURIfromParameters()
+ {
+ $this->markTestSkipped('No Propel fixture written yet..')
+ //$this->assertEquals('sfImageSource://TestRecord/file#1',
sfImageSourcePropel::buildURIfromParameters($this->testParameters));
+ }
+
+ protected function setUp()
+ {
+ $this->markTestSkipped('No Propel fixture written yet..')
+ //$this->dbh = new Propel_Adapter_Mock('mysql');
+ //$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..');
+
+ //$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.