From 606874e9a883ae547df198498fce6fca7b735466 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 10 Aug 2015 19:50:41 +0200 Subject: Fix TProperyValue::ensureEnum and some unit tests class names --- tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php | 14 +++++++------- tests/unit/PradoBaseTest.php | 2 +- tests/unit/Security/TUserManagerTest.php | 4 ++-- tests/unit/TComponentTest.php | 2 +- tests/unit/Web/THttpCookieCollectionTest.php | 2 +- tests/unit/Web/THttpRequestTest.php | 12 ++++++------ tests/unit/Web/THttpResponseTest.php | 2 +- tests/unit/Xml/TXmlElementTest.php | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) (limited to 'tests') diff --git a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php index 99118927..0a95e49f 100644 --- a/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php +++ b/tests/unit/Data/SqlMap/DataMapper/TPropertyAccessTest.php @@ -5,7 +5,7 @@ use Prado\Data\SqlMap\DataMapper\TPropertyAccess; /** - * @package System.Data.SqlMap.DataMapper + * @package System.Data.\SqlMap\\DataMapper.DataMapper */ class TPropertyAccessTest extends PHPUnit_Framework_TestCase { @@ -28,7 +28,7 @@ class TPropertyAccessTest extends PHPUnit_Framework_TestCase self::assertEquals(1, TPropertyAccess::get($testobj, 'a')); self::assertEquals(2, TPropertyAccess::get($testobj, 'b')); - self::setExpectedException('TInvalidPropertyException'); + self::setExpectedException('Prado\\Data\SqlMap\DataMapper\\TInvalidPropertyException'); TPropertyAccess::get($testobj, 'c'); } @@ -67,10 +67,10 @@ class TPropertyAccessTest extends PHPUnit_Framework_TestCase self::assertEquals(1, TPropertyAccess::get($testobj, 'A')); self::assertEquals(2, TPropertyAccess::get($testobj, 'B')); - self::setExpectedException('TInvalidPropertyException'); + self::setExpectedException('Prado\\Data\\SqlMap\\DataMapper\\TInvalidPropertyException'); TPropertyAccess::get($testobj, 'c'); - self::setExpectedException('TInvalidPropertyException'); + self::setExpectedException('Prado\\Data\\SqlMap\\DataMapper\\TInvalidPropertyException'); TPropertyAccess::get($testobj, 'C'); } @@ -96,7 +96,7 @@ class TPropertyAccessTest extends PHPUnit_Framework_TestCase TPropertyAccess::set($testobj, 'c', 30); self::assertEquals(30, TPropertyAccess::get($testobj, 'c')); - self::setExpectedException('TInvalidPropertyException'); + self::setExpectedException('Prado\\Data\\SqlMap\\DataMapper\\TInvalidPropertyException'); TPropertyAccess::get($testobj, 'C'); } @@ -189,10 +189,10 @@ class TPropertyAccessTest extends PHPUnit_Framework_TestCase self::assertNull(TPropertyAccess::get($testobj, 'a.e.c')); self::assertNull(TPropertyAccess::get($testobj, 'a.e.C')); - self::setExpectedException('TInvalidPropertyException'); + self::setExpectedException('Prado\\Data\\SqlMap\\DataMapper\\TInvalidPropertyException'); TPropertyAccess::get($testobj, 'a.c.C'); - self::setExpectedException('TInvalidPropertyException'); + self::setExpectedException('Prado\\Data\\SqlMap\\DataMapper\\TInvalidPropertyException'); TPropertyAccess::get($testobj, 'a.d.C'); } } diff --git a/tests/unit/PradoBaseTest.php b/tests/unit/PradoBaseTest.php index 94abb25e..0b9cd7d6 100644 --- a/tests/unit/PradoBaseTest.php +++ b/tests/unit/PradoBaseTest.php @@ -3,7 +3,7 @@ use Prado\Prado; /** - * @runTestsInSeparateProcesses + * @package System */ class PradoBaseTest extends PHPUnit_Framework_TestCase { diff --git a/tests/unit/Security/TUserManagerTest.php b/tests/unit/Security/TUserManagerTest.php index 146e590b..fff14912 100644 --- a/tests/unit/Security/TUserManagerTest.php +++ b/tests/unit/Security/TUserManagerTest.php @@ -121,10 +121,10 @@ class TUserManagerTest extends PHPUnit_Framework_TestCase { $userManager=new TUserManager (); $userManager->init (self::$config); $guest=$userManager->getUser(null); - self::assertInstanceOf('TUser', $guest); + self::assertInstanceOf('Prado\\Security\\TUser', $guest); self::assertTrue($guest->getIsGuest()); $user=$userManager->getUser('joe'); - self::assertInstanceOf('TUser', $user); + self::assertInstanceOf('Prado\\Security\\TUser', $user); self::assertEquals('joe', $user->getName()); self::assertEquals(array ('Writer'), $user->getRoles()); self::assertFalse($user->getIsGuest()); diff --git a/tests/unit/TComponentTest.php b/tests/unit/TComponentTest.php index 66b90684..033c373f 100644 --- a/tests/unit/TComponentTest.php +++ b/tests/unit/TComponentTest.php @@ -718,7 +718,7 @@ class TComponentTest extends PHPUnit_Framework_TestCase { public function testIsA() { //This doesn't check the IInstanceCheck functionality, separate function - $this->assertTrue($this->component->isa('TComponent')); + $this->assertTrue($this->component->isa('Prado\TComponent')); $this->assertTrue($this->component->isa('NewComponent')); $this->assertFalse($this->component->isa(new FooBehavior)); $this->assertFalse($this->component->isa('FooBehavior')); diff --git a/tests/unit/Web/THttpCookieCollectionTest.php b/tests/unit/Web/THttpCookieCollectionTest.php index 14b3f923..4ddc4da3 100644 --- a/tests/unit/Web/THttpCookieCollectionTest.php +++ b/tests/unit/Web/THttpCookieCollectionTest.php @@ -13,7 +13,7 @@ class THttpCookieCollectionTest extends PHPUnit_Framework_TestCase { public function testConstruct() { $coll=new THttpCookieCollection(); - self::assertInstanceOf('THttpCookieCollection', $coll); + self::assertInstanceOf('Prado\\Web\\THttpCookieCollection', $coll); } public function testInsertAt() { diff --git a/tests/unit/Web/THttpRequestTest.php b/tests/unit/Web/THttpRequestTest.php index 9b8168c3..f11e8c0f 100644 --- a/tests/unit/Web/THttpRequestTest.php +++ b/tests/unit/Web/THttpRequestTest.php @@ -72,13 +72,13 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase { public function testGetUrl() { $request = new THttpRequest(); $request->init(null); - self::assertInstanceOf('TUri', $request->getUrl()); + self::assertInstanceOf('Prado\\Web\\TUri', $request->getUrl()); // Try with $_SERVER['HTTP_HOST'] empty $request=null; $request = new THttpRequest(); $request->init(null); $_SERVER['HTTP_HOST']=''; - self::assertInstanceOf('TUri', $request->getUrl()); + self::assertInstanceOf('Prado\\Web\\TUri', $request->getUrl()); } public function testGetUrlManager() { @@ -122,7 +122,7 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase { $request->setUrlManager('goodmanager'); $request->init(null); self::assertEquals ('goodmanager', $request->getUrlManager()); - self::assertInstanceOf ('TUrlManager',$request->getUrlManagerModule()); + self::assertInstanceOf ('Prado\\Web\\TUrlManager',$request->getUrlManagerModule()); } @@ -281,7 +281,7 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase { $request->init (null); $request->setEnableCookieValidation (false); $cookies=$request->getCookies(); - self::assertInstanceOf('THttpCookieCollection', $cookies); + self::assertInstanceOf('Prado\\Web\\THttpCookieCollection', $cookies); self::assertEquals('0123456789abcdef', $cookies->itemAt('phpsessid')->getValue()); $request = null; @@ -293,7 +293,7 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase { $request->init (null); $request->setEnableCookieValidation (true); $cookies=$request->getCookies(); - self::assertInstanceOf('THttpCookieCollection', $cookies); + self::assertInstanceOf('Prado\\Web\\THttpCookieCollection', $cookies); self::assertEquals('0123456789abcdef', $cookies->itemAt('phpsessid')->getValue()); } @@ -338,7 +338,7 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase { public function testGetIterator() { $request = new THttpRequest (); $request->init(null); - self::assertInstanceOf ('TMapIterator', $request->getIterator()); + self::assertInstanceOf ('Prado\\Collections\\TMapIterator', $request->getIterator()); } public function testGetCount() { diff --git a/tests/unit/Web/THttpResponseTest.php b/tests/unit/Web/THttpResponseTest.php index 9af89900..d9d4b30f 100644 --- a/tests/unit/Web/THttpResponseTest.php +++ b/tests/unit/Web/THttpResponseTest.php @@ -92,7 +92,7 @@ class THttpResponseTest extends PHPUnit_Framework_TestCase { public function testGetCookies() { $response=new THttpResponse (); $response->init (null); - self::assertInstanceOf('THttpCookieCollection', $response->getCookies()); + self::assertInstanceOf('Prado\\Web\\THttpCookieCollection', $response->getCookies()); self::assertEquals(0, $response->getCookies()->getCount()); } diff --git a/tests/unit/Xml/TXmlElementTest.php b/tests/unit/Xml/TXmlElementTest.php index 49bd41ec..c268284a 100644 --- a/tests/unit/Xml/TXmlElementTest.php +++ b/tests/unit/Xml/TXmlElementTest.php @@ -62,7 +62,7 @@ class TXmlElementTest extends PHPUnit_Framework_TestCase { self::assertEquals(null, $element->getElementByTagName('first')); $element->Elements[] = new TXmlElement('first'); $first = $element->getElementByTagName('first'); - self::assertInstanceOf('TXmlElement', $first); + self::assertInstanceOf('Prado\\Xml\\TXmlElement', $first); self::assertEquals('first', $first->getTagName()); } -- cgit v1.2.3