4
Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion 
... \yii\framework\YiiBase.php on line 418

Yii v1.1.10
PHPUnit v3.6.10
PHPUnit_Selenium v​​ 1.2.6

「Yii 1.1 と PHP5 を使用したアジャイル Web 開発」という本のサンプルを実行しようとすると、このエラーが発生しますSiteTest:。しかし、どうすればこれを修正できますか?

更新 (解決済み):
どうやら、問題は上記の警告ではなく、今後別のエラーが発生する可能性があります。「curl_init()」は未定義です。すでに php_curl 拡張機能を有効にしていますが、CLI からの PHP は Apache と同じ .ini ファイルを使用していません。そのため、ini の CLI バージョンで php_curl を有効にした後、正常に動作するようになりました (まだ警告が表示されますが、テストは実行中です)。

4

3 に答える 3

0

これらの警告の表示は、php.ini の設定によって異なります。

error_reporting
display errors

この警告を表示したくない場合は、設定する必要があります

error_reporting(E_ALL & ~E_WARNING | E_STRICT)

また

ini_set('display_errors','off');

WebTestCase.php のディレクティブ

&&エラーをチェックするためにファイルへのエラーログをオフにしないでください

于 2012-07-01T09:12:11.827 に答える
0

There are some workarounds how to get rid of the warnings on Yii Framework Forum.

One of them involves editing PHPUnit core file Framework/TestSuite.php to supress warnings: put @ in front of method_exists($this->name, 'setUpBeforeClass') posted by Dmitriy K.

The other is more portable and right one. It is to comment browser lines in phpunit.xml:

    <selenium>
    <!--        <browser name="Internet Explorer" browser="*iexplore" />-->
    <!--        <browser name="Firefox" browser="*firefox" />-->
    </selenium>

And put into test script:

    parent::setUp();
    $this->setBrowser('*iexplore');
    $this->setBrowserUrl(TEST_BASE_URL);

posted by Vitalets

于 2012-06-28T11:10:37.813 に答える
-1

アプリをテストしようとしているときに同じ問題が発生しました。

セレンサーバー http://selenium.googlecode.com/files/selenium-server-standalone-2.22.0.jarをダウンロードして起動する必要があります

警告は表示されたままですが、テストは開始されます。

于 2012-05-31T09:26:58.537 に答える