Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added test cases

  • Loading branch information...
commit 1529a54d62de342fcc1cf16d7ecabb34495370cd 1 parent 5726cbb
@adrianj98 adrianj98 authored
Showing with 112 additions and 0 deletions.
  1. +17 −0 tests/bootstrap.php
  2. +95 −0 tests/core/cssManagerTest.php
View
17 tests/bootstrap.php
@@ -0,0 +1,17 @@
+<?php
+
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * @author adrian
+ */
+// TODO: check include path
+ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.dirname(__FILE__).'/../../../../Sandbox/Winginx/php5/pear');
+
+define('__SASS_PATH', dirname(dirname(__FILE__)).'/phpsass');
+
+// put your code here
+?>
View
95 tests/core/cssManagerTest.php
@@ -0,0 +1,95 @@
+<?php
+
+require_once dirname(__FILE__) . '/../../core/cssManager.php';
+
+/**
+ * Test class for cssManager.
+ * Generated by PHPUnit on 2012-11-10 at 23:23:48.
+ */
+class cssManagerTest extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @var cssManager
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp() {
+ $this->object = new cssManager;
+ }
+
+ /**
+ * Tears down the fixture, for example, closes a network connection.
+ * This method is called after a test is executed.
+ */
+ protected function tearDown() {
+
+ }
+
+ /**
+ * @covers cssManager::addCSS
+ * @todo Implement testAddCSS().
+ */
+ public function testAddCSS() {
+
+ $this->object->setCache(array());
+ $this->object->addCSS('thecssfile');
+ $cache = $this->object->getCache();
+ $this->assertEquals( 'thecssfile',$cache['99MG0']['assets']);
+ }
+
+ /**
+ * @covers cssManager::assCSSString
+ * @todo Implement testAssCSSString().
+ */
+ public function testAddCSSString() {
+ $this->object->setCache(array());
+ cssManager::addCSSString('bob','adsljknvaoiuspdkhe','assetsstring');
+ $cache = $this->object->getCache();
+ $this->assertEquals( 'assetsstring',$cache['Tl03k']['assets']);
+ $this->assertEquals( 'adsljknvaoiuspdkhe',$cache['Tl03k']['src']);
+ }
+
+ /**
+ * @covers cssManager::_convertUrl
+ * @todo Implement test_convertUrl().
+ */
+ public function test_convertUrl() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @covers cssManager::url
+ * @todo Implement testUrl().
+ */
+ public function testUrl() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @covers cssManager::render
+ * @todo Implement testRender().
+ */
+ public function testRender() {
+ $src = '
+ @import colors.scss;
+
+ ';
+ $this->object->render($src,false);
+ }
+ public function testUdihash()
+ {
+ $result = cssManager::udihash(44);
+ $this->assertEquals('AZD16', $result);
+ }
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.