summaryrefslogtreecommitdiff
path: root/tests/unit/PradoBaseTest.php
diff options
context:
space:
mode:
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));
+ }
+
+
+}