Explorar o código

[ZF-12071] Remove broken code from unittest Zend_Queue_QueueTest

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24670 44c647ce-9c0f-0410-b52a-842ac1e357ba
adamlundrigan %!s(int64=14) %!d(string=hai) anos
pai
achega
d5d8d6f076
Modificáronse 2 ficheiros con 4 adicións e 49 borrados
  1. 0 2
      tests/Zend/Queue/Custom/DbForUpdate.php
  2. 4 47
      tests/Zend/Queue/QueueTest.php

+ 0 - 2
tests/Zend/Queue/Custom/DbForUpdate.php

@@ -98,13 +98,11 @@ class Custom_DbForUpdate extends Zend_Queue_Adapter_Db
                 // the rows after our select, but before our update.
                 if ($count > 0) {
                     $msgs[] = $data;
-                    $this->getLogger()->debug('Received message:' . $data['message_id'] . ' byte size=' . strlen($data['body']));
                 }
             }
             $db->commit();
         } catch (Exception $e) {
             $db->rollBack();
-            $this->getLogger()->err($e->getMessage() . ' code ' . $e->getCode());
             /**
              * @see Zend_Queue_Exception
              */

+ 4 - 47
tests/Zend/Queue/QueueTest.php

@@ -56,22 +56,6 @@ class Zend_Queue_QueueTest extends PHPUnit_Framework_TestCase
         );
 
         $this->queue = new Zend_Queue('array', $this->config);
-
-        /**
-         * @see Zend_Log
-         */
-        require_once 'Zend/Log.php';
-        require_once 'Zend/Log/Writer/Stream.php';
-        require_once 'Zend/Log/Writer/Null.php';
-        if (! isset($this->logger)) {
-            if (1) { // vebose?
-                $this->_logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output'));
-            } else {
-                $this->_logger = new Zend_Log(new Zend_Log_Writer_Null());
-            }
-        }
-
-        $this->queue->setLogger($this->_logger);
     }
 
     protected function tearDown()
@@ -81,7 +65,7 @@ class Zend_Queue_QueueTest extends PHPUnit_Framework_TestCase
     public function testConst()
     {
         $this->assertTrue(is_string(Zend_Queue::TIMEOUT));
-        $this->assertTrue(is_integer(Zend_Queue::VISABILITY_TIMEOUT));
+        $this->assertTrue(is_integer(Zend_Queue::VISIBILITY_TIMEOUT));
         $this->assertTrue(is_string(Zend_Queue::NAME));
     }
 
@@ -100,17 +84,12 @@ class Zend_Queue_QueueTest extends PHPUnit_Framework_TestCase
             'adapter'   => 'array'
         );
 
+        require_once "Zend/Config.php";
         $zend_config = new Zend_Config($config);
 
         $obj = new Zend_Queue($config);
         $this->assertTrue($obj instanceof Zend_Queue);
 
-        // test logger
-        $this->assertTrue($obj->getLogger() instanceof Zend_Log);
-
-        $obj = new Zend_Queue($zend_config);
-        $this->assertTrue($obj instanceof Zend_Queue);
-
         try {
             $obj = new Zend_Queue('ops');
             $this->fail('Zend_Queue cannot accept a string');
@@ -119,9 +98,9 @@ class Zend_Queue_QueueTest extends PHPUnit_Framework_TestCase
         }
     }
 
-    public function test_getConfig()
+    public function test_getOptions()
     {
-        $config = $this->queue->getConfig();
+        $config = $this->queue->getOptions();
         $this->assertTrue(is_array($config));
         $this->assertEquals($this->config['name'], $config['name']);
     }
@@ -221,28 +200,6 @@ class Zend_Queue_QueueTest extends PHPUnit_Framework_TestCase
         }
     }
 
-    public function test_set_getLogger()
-    {
-        /**
-         * @see Zend_Log
-         */
-        require_once 'Zend/Log.php';
-        require_once 'Zend/Log/Writer/Null.php';
-
-        $logger = new Zend_Log(new Zend_Log_Writer_Null);
-
-        $this->assertTrue($this->queue->setLogger($logger) instanceof Zend_Queue);
-        $this->assertTrue($this->queue->getLogger() instanceof Zend_Log);
-
-        // parameter verification
-        try {
-            $this->queue->setLogger(array());
-            $this->fail('setlogger() passed an array and succeeded (bad)');
-        } catch (Exception $e) {
-            $this->assertTrue(true);
-        }
-    }
-
     public function test_capabilities()
     {
         $list = $this->queue->getCapabilities();