Browse Source

More tests.

euromark 11 years ago
parent
commit
dacdaa3b36

+ 4 - 1
phpunit.xml.dist

@@ -26,10 +26,13 @@
 	<filter>
 	<filter>
 		<whitelist>
 		<whitelist>
 			<directory suffix=".php">./src</directory>
 			<directory suffix=".php">./src</directory>
+			<exclude>
+				<file>./src/Utility/Set.php</file>
+				<file>./src/Utility/Multibyte.php</file>
+			</exclude>
 		</whitelist>
 		</whitelist>
 		<blacklist>
 		<blacklist>
 			<directory suffix=".ctp">./src/Template</directory>
 			<directory suffix=".ctp">./src/Template</directory>
-			<file>./src/Utility/Set.php</file>
 		</blacklist>
 		</blacklist>
 	</filter>
 	</filter>
 </phpunit>
 </phpunit>

+ 1 - 0
src/Controller/Component/Component.php

@@ -2,6 +2,7 @@
 namespace Tools\Controller\Component;
 namespace Tools\Controller\Component;
 
 
 use Cake\Controller\Component as CakeComponent;
 use Cake\Controller\Component as CakeComponent;
+use Cake\Event\Event;
 
 
 /**
 /**
  * Convenience class that automatically provides the component's methods with
  * Convenience class that automatically provides the component's methods with

+ 39 - 0
tests/TestCase/Controller/Component/ComponentTest.php

@@ -0,0 +1,39 @@
+<?php
+namespace Tools\Test\TestCase\Controller\Component;
+
+use Cake\Controller\ComponentRegistry;
+use Cake\Controller\Controller;
+use Tools\Controller\Component\Component;
+use Cake\Network\Request;
+use Tools\TestSuite\TestCase;
+use Cake\Event\Event;
+/**
+ * SessionComponentTest class
+ *
+ */
+class ComponentTest extends TestCase {
+
+/**
+ * setUp method
+ *
+ * @return void
+ */
+	public function setUp() {
+		$this->Controller = new Controller(new Request());
+		$this->ComponentRegistry = new ComponentRegistry($this->Controller);
+	}
+
+/**
+ * testBeforeFilter method
+ *
+ * @return void
+ */
+	public function testBeforeFilter() {
+		$Component = new Component($this->ComponentRegistry);
+		$event = new Event('Controller.startup', $this->Controller);
+		$Component->beforeFilter($event);
+
+		$this->assertInstanceOf('Cake\Controller\Controller', $Component->Controller);
+	}
+
+}

+ 31 - 0
tests/TestCase/TestSuite/IntegrationTestCaseTest.php

@@ -0,0 +1,31 @@
+<?php
+namespace Tools\TestCase\TestSuite;
+
+use Tools\TestSuite\IntegrationTestCase;
+
+class IntegrationTestCaseTest extends IntegrationTestCase {
+
+	public $TestCase;
+
+	public function setUp() {
+		parent::setUp();
+	}
+
+	public function tearDown() {
+		parent::tearDown();
+	}
+
+	/**
+	 * @return void
+	 */
+	public function testFoo() {
+		$this->debug('Foo');
+
+		$x = $this->osFix("\r\n");
+		$this->assertSame("\n", $x);
+
+		$result = $this->isDebug();
+		$this->assertFalse($result);
+	}
+
+}