2
0
Просмотр исходного кода

Zend_Service_ShortUrl: Fix minor unit test failure.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23178 44c647ce-9c0f-0410-b52a-842ac1e357ba
alexander 15 лет назад
Родитель
Сommit
6114eee5e9
1 измененных файлов с 16 добавлено и 13 удалено
  1. 16 13
      tests/Zend/Service/ShortUrl/IsGdTest.php

+ 16 - 13
tests/Zend/Service/ShortUrl/IsGdTest.php

@@ -39,7 +39,7 @@ class Zend_Service_ShortUrl_IsGdTest extends PHPUnit_Framework_TestCase
      * @var Zend_Service_ShortUrl_IsGd
      */
     protected $_s;
-    
+
     /**
      * Creates a new Zend_Service_ShortUrl_IsGd object for each test method
      *
@@ -56,49 +56,52 @@ class Zend_Service_ShortUrl_IsGdTest extends PHPUnit_Framework_TestCase
         $this->setExpectedException('Zend_Service_ShortUrl_Exception');
         $this->_s->shorten('');
     }
-    
+
     public function testShortenIncorrectUrlException()
     {
         $this->setExpectedException('Zend_Service_ShortUrl_Exception');
         $this->_s->shorten('wrongAdress.cccc');
     }
-    
+
     public function testShorten()
     {
         $urls = array(
-            'http://framework.zend.com/'           => 'http://is.gd/g87rz',
-            'http://framework.zend.com/manual/en/' => 'http://is.gd/g87LE',
+            'http://framework.zend.com/',
+            'http://framework.zend.com/manual/en/',
         );
-        
-        foreach ($urls as $url => $shortenedUrl) {
-            $this->assertEquals($shortenedUrl, $this->_s->shorten($url));
+
+        foreach ($urls as $url) {
+            $shortenedUrl = $this->_s->shorten($url);
+
+            $this->assertNotEquals($url, $shortenedUrl);
+            $this->assertEquals($url, $this->_s->unshorten($shortenedUrl));
         }
     }
-    
+
     public function testUnshorten()
     {
         $urls = array(
             'http://framework.zend.com/'           => 'http://is.gd/g3ASn',
             'http://framework.zend.com/manual/en/' => 'http://is.gd/g3AVm'
         );
-        
+
         foreach ($urls as $url => $shortenedUrl) {
             $this->assertEquals($url, $this->_s->unshorten($shortenedUrl));
         }
     }
-    
+
     public function testUnshortenEmptyUrlException()
     {
         $this->setExpectedException('Zend_Service_ShortUrl_Exception');
         $this->_s->unshorten('');
     }
-    
+
     public function testUnshortenIncorrectUrlException()
     {
         $this->setExpectedException('Zend_Service_ShortUrl_Exception');
         $this->_s->unshorten('wrongAdress.cccc');
     }
-    
+
     public function testUnshortenWrongUrlException()
     {
         $this->setExpectedException('Zend_Service_ShortUrl_Exception');