[limb-svn] r6886 - in 3.x/trunk/limb: . cms/tests/cases config/tests/cases imagekit/tests/cases search/tests/cases session/tests/cases tree/tests/cases web_agent/tests

svn at limb-project.com svn at limb-project.com
Wed Apr 2 00:01:59 MSD 2008


Author: pachanga
Date: 2008-04-02 00:01:59 +0400 (Wed, 02 Apr 2008)
New Revision: 6886
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6886

Modified:
   3.x/trunk/limb/cms/tests/cases/.setup.php
   3.x/trunk/limb/cms/tests/cases/.skipif.php
   3.x/trunk/limb/config/tests/cases/.setup.php
   3.x/trunk/limb/imagekit/tests/cases/.setup.php
   3.x/trunk/limb/imagekit/tests/cases/lmbImageKitTest.class.php
   3.x/trunk/limb/runtests.php
   3.x/trunk/limb/search/tests/cases/.skipif.php
   3.x/trunk/limb/session/tests/cases/.skipif.php
   3.x/trunk/limb/tree/tests/cases/.skipif.php
   3.x/trunk/limb/web_agent/tests/.setup.php
Log:
-- isolating tests further

Modified: 3.x/trunk/limb/cms/tests/cases/.setup.php
===================================================================
--- 3.x/trunk/limb/cms/tests/cases/.setup.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/cms/tests/cases/.setup.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -1,7 +1,17 @@
 <?php
+if(!defined('LIMB_VAR_DIR'))
+{
+  @define('LIMB_VAR_DIR', dirname(__FILE__) . '/../../../var');
+  if(!is_dir(LIMB_VAR_DIR) && !mkdir(LIMB_VAR_DIR))
+    throw new Exception("Could not create LIMB_VAR_DIR at '" . LIMB_VAR_DIR . "' during tests execution");
+}
+
 require_once(dirname(__FILE__) . '/../../common.inc.php');
 require_once(dirname(__FILE__) . '/lmbCmsTestCase.class.php');
-require_once('limb/dbal/src/lmbDbDump.class.php');
-$this->dump = new lmbDbDump(dirname(__FILE__) . '/.fixtures/init_tests.mysql');
-$this->dump->load();
 
+if(lmbToolkit::instance()->isDefaultDbDSNAvailable())
+{
+  require_once('limb/dbal/src/lmbDbDump.class.php');
+  $this->dump = new lmbDbDump(dirname(__FILE__) . '/.fixtures/init_tests.mysql');
+  $this->dump->load();
+}

Modified: 3.x/trunk/limb/cms/tests/cases/.skipif.php
===================================================================
--- 3.x/trunk/limb/cms/tests/cases/.skipif.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/cms/tests/cases/.skipif.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -1,6 +1,12 @@
 <?php
 require_once(dirname(__FILE__) . '/../../common.inc.php');
 
+if(!lmbToolkit::instance()->isDefaultDbDSNAvailable())
+{
+  echo "\nThere is no default database connection DSN available, CMS package tests skipped\n\n";
+  return true;
+}
+
 $type = lmbToolkit :: instance()->getDefaultDbConnection()->getType();
 $ignore = !file_exists(dirname(__FILE__) . '/.fixtures/init_tests.' . $type);
 $test_dir = basename(dirname(__FILE__));

Modified: 3.x/trunk/limb/config/tests/cases/.setup.php
===================================================================
--- 3.x/trunk/limb/config/tests/cases/.setup.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/config/tests/cases/.setup.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -1,4 +1,10 @@
 <?php
+if(!defined('LIMB_VAR_DIR'))
+{
+  @define('LIMB_VAR_DIR', dirname(__FILE__) . '/../../../var');
+  if(!is_dir(LIMB_VAR_DIR) && !mkdir(LIMB_VAR_DIR))
+    throw new Exception("Could not create LIMB_VAR_DIR at '" . LIMB_VAR_DIR . "' during tests execution");
+}
+
 require_once(dirname(__FILE__) . '/../../common.inc.php');
 
-

Modified: 3.x/trunk/limb/imagekit/tests/cases/.setup.php
===================================================================
--- 3.x/trunk/limb/imagekit/tests/cases/.setup.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/imagekit/tests/cases/.setup.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -1,4 +1,10 @@
 <?php
+if(!defined('LIMB_VAR_DIR'))
+{
+  @define('LIMB_VAR_DIR', dirname(__FILE__) . '/../../../var');
+  if(!is_dir(LIMB_VAR_DIR) && !mkdir(LIMB_VAR_DIR))
+    throw new Exception("Could not create LIMB_VAR_DIR at '" . LIMB_VAR_DIR . "' during tests execution");
+}
+
 require_once(dirname(__FILE__) . '/../../common.inc.php');
 
-

Modified: 3.x/trunk/limb/imagekit/tests/cases/lmbImageKitTest.class.php
===================================================================
--- 3.x/trunk/limb/imagekit/tests/cases/lmbImageKitTest.class.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/imagekit/tests/cases/lmbImageKitTest.class.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -9,7 +9,12 @@
 
 lmb_require(dirname(__FILE__).'/../../src/lmbImageKit.class.php');
 
-class lmbImageKitTest extends UnitTestCase {
+class lmbImageKitTest extends UnitTestCase 
+{
+  function skip()
+  {
+    $this->skipIf(!extension_loaded('gd'), 'GD extension not found. Test skipped.');
+  }
 
   function _getInputImage()
   {
@@ -24,13 +29,15 @@
   function testCreateGdConvertor()
   {
     $conv = lmbImageKit::create('gd');
-
     $this->assertIsA($conv, 'lmbGdImageConvertor');
   }
 
   function testTraversing()
   {
-    lmbImageKit::load($this->_getInputImage())->apply('resize', array('width' => 50, 'height' => 60, 'preserve_aspect_ratio' => false))->apply('rotate', array('angle' => 90))->save($this->_getOutputImage());
+    lmbImageKit::load($this->_getInputImage())->
+      apply('resize', array('width' => 50, 'height' => 60, 'preserve_aspect_ratio' => false))->
+      apply('rotate', array('angle' => 90))->
+      save($this->_getOutputImage());
 
     list($width, $height, $type) = getimagesize($this->_getOutputImage());
     $this->assertEqual($width, 60);
@@ -39,7 +46,10 @@
 
   function testTraversingByOverloading()
   {
-    lmbImageKit::load($this->_getInputImage())->resize(array('width' => 50, 'height' => 60, 'preserve_aspect_ratio' => false))->rotate(array('angle' => 90))->save($this->_getOutputImage());
+    lmbImageKit::load($this->_getInputImage())->
+      resize(array('width' => 50, 'height' => 60, 'preserve_aspect_ratio' => false))->
+      rotate(array('angle' => 90))->
+      save($this->_getOutputImage());
 
     list($width, $height, $type) = getimagesize($this->_getOutputImage());
     $this->assertEqual($width, 60);
@@ -51,4 +61,3 @@
     @unlink($this->_getOutputImage());
   }
 }
-?>
\ No newline at end of file

Modified: 3.x/trunk/limb/runtests.php
===================================================================
--- 3.x/trunk/limb/runtests.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/runtests.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -3,6 +3,7 @@
 
 require_once(dirname(__FILE__) . '/tests_runner/common.inc.php');
 require_once(dirname(__FILE__) . '/tests_runner/src/lmbTestRunner.class.php');
+require_once(dirname(__FILE__) . '/tests_runner/src/lmbTestTreeFilePathNode.class.php');
 require_once(dirname(__FILE__) . '/tests_runner/src/lmbTestTreeGlobNode.class.php');
 
 $packages = null;
@@ -19,7 +20,7 @@
     $runner = new lmbTestRunner();
     $path = dirname(__FILE__) . '/' . $pkg . '/tests/cases/';
     if(is_dir($path))
-      $res &= $runner->run(new lmbTestTreeDirNode($path));
+      $res &= $runner->run(new lmbTestTreeFilePathNode($path));
   }
 }
 else

Modified: 3.x/trunk/limb/search/tests/cases/.skipif.php
===================================================================
--- 3.x/trunk/limb/search/tests/cases/.skipif.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/search/tests/cases/.skipif.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -1,4 +1,17 @@
 <?php
 require_once('limb/dbal/common.inc.php');
-return lmbToolkit :: instance()->getDefaultDbConnection()->getType() != 'mysql';
 
+if(!lmbToolkit::instance()->isDefaultDbDSNAvailable())
+{
+  echo "\nThere is no default database connection DSN available, SEARCH package tests skipped\n\n";
+  return true;
+}
+
+if(lmbToolkit :: instance()->getDefaultDbConnection()->getType() != 'mysql')
+{
+  echo "\nSEARCH package tests are skipped! Only MySQL database is supported\n\n";
+  return true;
+}
+
+return false;
+

Modified: 3.x/trunk/limb/session/tests/cases/.skipif.php
===================================================================
--- 3.x/trunk/limb/session/tests/cases/.skipif.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/session/tests/cases/.skipif.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -1,6 +1,12 @@
 <?php
 require_once(dirname(__FILE__) . '/../../common.inc.php');
 
+if(!lmbToolkit::instance()->isDefaultDbDSNAvailable())
+{
+  echo "\nThere is no default database connection DSN available, SESSION package tests skipped\n\n";
+  return true;
+}
+
 $type = lmbToolkit :: instance()->getDefaultDbConnection()->getType();
 $ignore = !file_exists(dirname(__FILE__) . '/.fixture/init_tests.' . $type);
 $test_dir = basename(dirname(__FILE__));

Modified: 3.x/trunk/limb/tree/tests/cases/.skipif.php
===================================================================
--- 3.x/trunk/limb/tree/tests/cases/.skipif.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/tree/tests/cases/.skipif.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -1,6 +1,12 @@
 <?php
 require_once(dirname(__FILE__) . '/../../common.inc.php');
 
+if(!lmbToolkit::instance()->isDefaultDbDSNAvailable())
+{
+  echo "\nThere is no default database connection DSN available, TREE package tests skipped\n\n";
+  return true;
+}
+
 $type = lmbToolkit :: instance()->getDefaultDbConnection()->getType();
 $ignore = !file_exists(dirname(__FILE__) . '/../../init/init_tests.' . $type);
 $test_dir = basename(dirname(__FILE__));

Modified: 3.x/trunk/limb/web_agent/tests/.setup.php
===================================================================
--- 3.x/trunk/limb/web_agent/tests/.setup.php	2008-04-01 18:34:17 UTC (rev 6885)
+++ 3.x/trunk/limb/web_agent/tests/.setup.php	2008-04-01 20:01:59 UTC (rev 6886)
@@ -1,58 +1,58 @@
-<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com
- * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
- * @license    LGPL http://www.gnu.org/copyleft/lesser.html
- */
-
-lmb_require('limb/web_agent/src/request/lmbAbstractWebAgentRequest.class.php');
-lmb_require('limb/web_agent/src/lmbWebServerResponse.class.php');
-lmb_require('limb/web_agent/src/lmbWebAgentCookies.class.php');
-lmb_require('limb/web_agent/src/lmbWebServerCookiesCollection.class.php');
-
-/**
- * @package web_agent
- * @version $Id: .setup.php 43 2007-10-05 15:33:11Z CatMan $
- */
-class lmbFakeWebAgentRequest extends lmbAbstractWebAgentRequest {
-
-  public $response_content = '';
-  public $response_status = 200;
-  public $response_mediatype = '';
-  public $response_charset = '';
-  public $response_headers;
-  public $response_cookies;
-
-  public $request_cookies;
-  public $request_content = '';
-  public $request_url = '';
-  public $request_accept_charset = '';
-
-  function __construct()
-  {
-    parent::__construct();
-    $this->response_headers = new lmbWebAgentHeaders();
-    $this->response_cookies = new lmbWebServerCookiesCollection();
-  }
-
-  function doRequest($url, $method = 'GET')
-  {
-    $this->request_cookies = clone $this->cookies;
-    $this->request_content = $this->content;
-    $this->request_accept_charset = $this->accept_charset;
-    $this->request_url = $url;
-    return new lmbWebServerResponse(
-      $this->response_content,
-      $this->response_status,
-      $this->response_mediatype,
-      $this->response_charset,
-      $this->response_cookies,
-      $this->response_headers
-    );
-  }
-
-}
-
-?>
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+
+require_once(dirname(__FILE__) . '/../common.inc.php');
+lmb_require('limb/web_agent/src/request/lmbAbstractWebAgentRequest.class.php');
+lmb_require('limb/web_agent/src/lmbWebServerResponse.class.php');
+lmb_require('limb/web_agent/src/lmbWebAgentCookies.class.php');
+lmb_require('limb/web_agent/src/lmbWebServerCookiesCollection.class.php');
+
+/**
+ * @package web_agent
+ * @version $Id: .setup.php 43 2007-10-05 15:33:11Z CatMan $
+ */
+class lmbFakeWebAgentRequest extends lmbAbstractWebAgentRequest 
+{
+
+  public $response_content = '';
+  public $response_status = 200;
+  public $response_mediatype = '';
+  public $response_charset = '';
+  public $response_headers;
+  public $response_cookies;
+
+  public $request_cookies;
+  public $request_content = '';
+  public $request_url = '';
+  public $request_accept_charset = '';
+
+  function __construct()
+  {
+    parent::__construct();
+    $this->response_headers = new lmbWebAgentHeaders();
+    $this->response_cookies = new lmbWebServerCookiesCollection();
+  }
+
+  function doRequest($url, $method = 'GET')
+  {
+    $this->request_cookies = clone $this->cookies;
+    $this->request_content = $this->content;
+    $this->request_accept_charset = $this->accept_charset;
+    $this->request_url = $url;
+    return new lmbWebServerResponse(
+      $this->response_content,
+      $this->response_status,
+      $this->response_mediatype,
+      $this->response_charset,
+      $this->response_cookies,
+      $this->response_headers
+    );
+  }
+}
+



More information about the limb-svn mailing list