summaryrefslogtreecommitdiff
path: root/tests/unit/PradoBaseTest.php
diff options
context:
space:
mode:
authorDavid <ottodavid@gmx.net>2015-08-10 06:42:01 +0200
committerDavid <ottodavid@gmx.net>2015-08-10 17:22:33 +0200
commit2bf1a517f3edc1bd43b8e3340f0f6fd31b1ba94a (patch)
tree285d7182be15299d8c0cdac1bd8aa1e397fa69d4 /tests/unit/PradoBaseTest.php
parent92ee7558c6b6dd2461b645cb1f19a81ef8c50db5 (diff)
fix unit tests
Diffstat (limited to 'tests/unit/PradoBaseTest.php')
-rw-r--r--tests/unit/PradoBaseTest.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/unit/PradoBaseTest.php b/tests/unit/PradoBaseTest.php
new file mode 100644
index 00000000..94abb25e
--- /dev/null
+++ b/tests/unit/PradoBaseTest.php
@@ -0,0 +1,40 @@
+<?php
+
+use Prado\Prado;
+
+/**
+ * @runTestsInSeparateProcesses
+ */
+class PradoBaseTest extends PHPUnit_Framework_TestCase
+{
+ const INTERFACE_FQN = 'Prado\\Web\\UI\\IValidatable';
+ const INTERFACE_SHORT_NAME = 'IValidatable';
+ const CLASS_FQN = 'Prado\\Web\\UI\\WebControls\\TButton';
+ const CLASS_PRADO_FULLNAME = 'System.Web.UI.WebControls.TButton';
+
+ public function testUsingNamespace()
+ {
+ $this->assertFalse(class_exists(self::CLASS_FQN, false));
+ Prado::using(self::CLASS_FQN);
+ $this->assertTrue(class_exists(self::CLASS_FQN, false));
+ }
+
+ public function testUsingInterface()
+ {
+ $this->assertFalse(interface_exists(self::INTERFACE_SHORT_NAME, false));
+ Prado::using(self::INTERFACE_FQN);
+ $this->assertTrue(interface_exists(self::INTERFACE_SHORT_NAME, false));
+ }
+
+ public function testCreateComponentWithNamespace()
+ {
+ $this->assertInstanceOf(self::CLASS_FQN, Prado::createComponent(self::CLASS_FQN));
+ }
+
+ public function testCreateComponentWithPradoNamespace()
+ {
+ $this->assertInstanceOf(self::CLASS_FQN, Prado::createComponent(self::CLASS_PRADO_FULLNAME));
+ }
+
+
+}