久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <tfoot id='lpI9A'></tfoot>
    <i id='lpI9A'><tr id='lpI9A'><dt id='lpI9A'><q id='lpI9A'><span id='lpI9A'><b id='lpI9A'><form id='lpI9A'><ins id='lpI9A'></ins><ul id='lpI9A'></ul><sub id='lpI9A'></sub></form><legend id='lpI9A'></legend><bdo id='lpI9A'><pre id='lpI9A'><center id='lpI9A'></center></pre></bdo></b><th id='lpI9A'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lpI9A'><tfoot id='lpI9A'></tfoot><dl id='lpI9A'><fieldset id='lpI9A'></fieldset></dl></div>

      • <bdo id='lpI9A'></bdo><ul id='lpI9A'></ul>

      <small id='lpI9A'></small><noframes id='lpI9A'>

    1. <legend id='lpI9A'><style id='lpI9A'><dir id='lpI9A'><q id='lpI9A'></q></dir></style></legend>
    2. PHPUnit 輸出導致 Zend_Session 異常

      PHPUnit output causing Zend_Session exceptions(PHPUnit 輸出導致 Zend_Session 異常)

        <tbody id='TgnEX'></tbody>
      <tfoot id='TgnEX'></tfoot>
        1. <small id='TgnEX'></small><noframes id='TgnEX'>

        2. <i id='TgnEX'><tr id='TgnEX'><dt id='TgnEX'><q id='TgnEX'><span id='TgnEX'><b id='TgnEX'><form id='TgnEX'><ins id='TgnEX'></ins><ul id='TgnEX'></ul><sub id='TgnEX'></sub></form><legend id='TgnEX'></legend><bdo id='TgnEX'><pre id='TgnEX'><center id='TgnEX'></center></pre></bdo></b><th id='TgnEX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TgnEX'><tfoot id='TgnEX'></tfoot><dl id='TgnEX'><fieldset id='TgnEX'></fieldset></dl></div>

        3. <legend id='TgnEX'><style id='TgnEX'><dir id='TgnEX'><q id='TgnEX'></q></dir></style></legend>

              • <bdo id='TgnEX'></bdo><ul id='TgnEX'></ul>
                本文介紹了PHPUnit 輸出導致 Zend_Session 異常的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我收到了許多與此完全相同的錯誤:

                Zend_Session_Exception:會話必須在任何輸出發送到瀏覽器之前啟動;輸出開始于/usr/local/zend/share/pear/PHPUnit/Util/Printer.php/173

                運行我的應用程序的測試套件時.這是 PHPUnit 3.5.10 和 PHP 5.3.5.

                沒有神秘的、意外的空白輸出導致這種情況.我已經確定發送到瀏覽器的輸出"是正在執行的 PHPUnit 測試的實際輸出.如果我打開 PHPUnit/Util/Printer.php 并將 print $buffer 行與 if (strpos($buffer, 'PHPUnit 3.5.10 by Sebastian Bergmann') === false)(有效停止PHPUnit的第一行輸出),然后我的第一個測試成功(直到測試用例輸出一個點表示測試成功,然后下一個測試失敗,因為輸出了點).>

                我團隊中的另一位開發人員能夠成功運行完整的測試套件,所以我知道這不是應用程序代碼的問題.一定是我本地環境的一些配置設置或問題.

                我已經檢查了 php.ini 以驗證 output_buffering 已打開并且 implicit_flush 已關閉,它們確實如此.

                我還嘗試將 Zend_Session::$_unitTestEnabled = true; 添加到我的測試引導程序中,但這并沒有幫助(無論如何應該沒有必要,因為它可以在另一個開發人員的機器上運行在我們的 CI 服務器上沒有它).

                除了忽略錯誤之外還有什么建議嗎?我從來沒有見過這樣的事情,真的很茫然.

                謝謝!

                更新:

                為了進一步隔離問題,我通過執行以下測試腳本將 ZF 和我的應用程序排除在外:

                assertTrue(true);}}

                測試失敗:

                1) SessionTest::testSessionsession_start():無法發送會話 cookie - 頭已經發送(輸出開始于/home/mmsa/test.php:1)

                然而,完全相同的測試適用于朋友的機器.相同版本的 PHP 和 PHPUnit.

                解決方案

                使用 -stderr 標志運行 phpunit,(新版本可能使用 --stderr 代替)例如

                 phpunit -stderr mytest.php# 或者phpunit --stderr mytest.php

                這會將 phpunit 的輸出定向到 stderr,防止它中斷 HTTP 標頭生成.

                該測試可能適用于您朋友的機器,因為他啟用了輸出緩沖(盡管我不確定這在 CLI 上下文中是否相關).

                I am getting numerous errors exactly like this one:

                Zend_Session_Exception: Session must be started before any output has been sent to the browser; output started in /usr/local/zend/share/pear/PHPUnit/Util/Printer.php/173
                

                When running my application's test suite. This is with PHPUnit 3.5.10 and PHP 5.3.5.

                There is no mysterious, unexpected whitespace output that is causing this. I've determined that the "output being sent to the browser" is the actual output from the PHPUnit tests being executed. If I open up PHPUnit/Util/Printer.php and wrap the print $buffer line with if (strpos($buffer, 'PHPUnit 3.5.10 by Sebastian Bergmann') === false) (effectively stopping the first line of output from PHPUnit), then my first test succeeds (until the test case outputs a dot indicating that the test succeeded, then the next test fails because the dot was output).

                Another developer on my team is able to run the full test suite successfully, so I know it's not a problem with the application code. It must be some configuration setting or problem with my local environment.

                I've already checked php.ini to verify that output_buffering is turned on and implicit_flush is turned off, and they are.

                I've also tried adding Zend_Session::$_unitTestEnabled = true; to my test bootstrap, but that didn't help (and shouldn't be necessary anyway because it works on another developer's machine and on our CI server without it).

                Any suggestions besides ignoring the errors? I've never seen anything like this and am truly at a loss.

                Thanks!

                UPDATE:

                To attempt to further isolate the problem, I took ZF and my application out of the equation by executing the following test script:

                <?php
                
                class SessionTest extends PHPUnit_Framework_TestCase
                {
                    public function testSession()
                    {
                        session_start();
                        $this->assertTrue(true);
                    }
                }
                

                The test fails:

                1) SessionTest::testSession
                session_start(): Cannot send session cookie - headers already sent by (output started at /home/mmsa/test.php:1)
                

                However, the exact same test works on a friend's machine. Same version of PHP and PHPUnit.

                解決方案

                Run phpunit with the -stderr flag, (newer versions may use --stderr instead) e.g.

                 phpunit -stderr mytest.php
                 # or
                 phpunit --stderr mytest.php
                

                This directs phpunit's output to stderr, preventing it from interrupting HTTP header generation.

                It's possible that the test works on your friend's machine because he has output buffering enabled (although I'm not sure if that's relevant in a CLI context).

                這篇關于PHPUnit 輸出導致 Zend_Session 異常的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                <i id='UtYYu'><tr id='UtYYu'><dt id='UtYYu'><q id='UtYYu'><span id='UtYYu'><b id='UtYYu'><form id='UtYYu'><ins id='UtYYu'></ins><ul id='UtYYu'></ul><sub id='UtYYu'></sub></form><legend id='UtYYu'></legend><bdo id='UtYYu'><pre id='UtYYu'><center id='UtYYu'></center></pre></bdo></b><th id='UtYYu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UtYYu'><tfoot id='UtYYu'></tfoot><dl id='UtYYu'><fieldset id='UtYYu'></fieldset></dl></div>
                <tfoot id='UtYYu'></tfoot>
              • <legend id='UtYYu'><style id='UtYYu'><dir id='UtYYu'><q id='UtYYu'></q></dir></style></legend>
              • <small id='UtYYu'></small><noframes id='UtYYu'>

                  <bdo id='UtYYu'></bdo><ul id='UtYYu'></ul>

                        <tbody id='UtYYu'></tbody>
                          主站蜘蛛池模板: 国产精品美女久久久久aⅴ国产馆 | 国产一区二区三区免费 | 在线观看第一区 | 国内自拍偷拍视频 | 成人黄色av网址 | 欧美久久久久久 | 欧美一区二区三区在线观看视频 | 日韩一区中文字幕 | 久久久蜜臀国产一区二区 | 午夜影院在线观看免费 | a国产一区二区免费入口 | 美女久久| 精品国产乱码久久久久久影片 | 国产精品视频网 | 久久男人天堂 | 99免费在线 | www.99热.com| 久久一区二区视频 | 久久高清| av一级久久 | 亚洲日韩中文字幕一区 | 日韩男人天堂 | 一区二区三区韩国 | 国产区在线免费观看 | 天堂资源最新在线 | 国产成人a亚洲精品 | 国产va| 国产美女特级嫩嫩嫩bbb片 | 狠狠干美女 | 99精品久久 | 国产欧美一区二区三区免费 | 成人在线视频网 | 国产婷婷在线视频 | 国产精品久久国产精品 | 91精品一区二区 | 国产亚洲精品一区二区三区 | 成人欧美一区二区三区在线播放 | 国产精品免费视频一区 | 亚洲三区在线观看 | 国产欧美日韩一区二区三区在线 | 亚洲69p|