phpunit+selenium 環境構築
この環境を構築するのに多くのトラブルに遭遇し、結局自分では解決できませんでしたが、幸いにも同僚の "frog" が解決してくれました。この問題!ここでは、皆さんの利便性を願って、私個人のテストの手順をリストします。
pear をインストールします:
Go-pear.pharダウンロードアドレス: http://download.csdn.net/detail/e421083458/4602207
go-pear.phar ファイルを の C:wampbinphpphp5.3.13PEAR
にダウンロードします。次に、次のコマンドを実行します:
cd C:\wamp\bin\php\php5.3.13 php -d phar.require_hash=0 PEAR/go-pear.phar
それが表示されたら Enter を押し、Y を入力して Y を押します。インストール後、ダブルクリックするよう求められます。
c:wampbinphpphp5.3.13PEAR_ENV.reg を実行して環境変数を追加します。次の操作と今後の使用を容易にするために、環境変数に php を追加する必要があります。
梨のアップグレード:
phpunit を直接インストールすると、バージョンが低すぎるというメッセージが表示されます。ここで pear をアップグレードする必要があります。
Pear clear-cache pear upgrade pear
アップグレードが成功した後のスクリーンショット:
Pear upgrade-all
製品アップグレード後のスクリーンショット
phpunit
をインストールしますpear clear-cache pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear install -a -f phpunit/PHPUnit
インストール成功のスクリーンショット:
phpunit拡張機能
をインストールします
pear channel-discover pear.symfony.com pear install phpunit/DbUnit pear channel-discover pear.phpunit.de pear install phpunit/PHPUnit_Story
成功したスクリーンショット:
selenium拡張機能
をインストールしますpear install phpunit/PHPUnit_Selenium
成功したスクリーンショット:
セレンをデバッグする
selenium-server-standalone-2.6.0.jarダウンロードアドレス: http://download.csdn.net/detail/e421083458/4882037
selenium-server
を開きますjava -jar C:\wamp\selenium-server-standalone-2.25.0.jar -interactive -log selenium.log
成功したスクリーンショット:
firefox の selenium IDE プラグイン
をインストールします。アドレス: http://seleniumhq.org/download/
1.9.0 をクリックして、Selenium IDE をインストールします。
具体的な記録方法については、以下を参照してください:
http://blog.163.com/lgh_2002/blog/static/44017526201259113351146/
テストスクリプト:
baiduCase.php
<?php class Example extends PHPUnit_Extensions_SeleniumTestCase { protected function setUp() { $this->setBrowser("*firefox"); $this->setBrowserUrl("http://www.baidu.com/"); } public function testMyTestCase() { $this->open("/"); $this->type("id=kw", "你好"); $this->click("id=su"); $this->waitForPageToLoad("30000"); $this->assertEquals(0,0); } } ?>
テストを開始します:
phpunit baiduCase.php
成功したテストのスクリーンショット:
参考ドキュメント:
http://www.phpunit.de/manual/3.7/en/index.html
http://pear.phpunit.de/
http://seleniumhq.org/download/

tomakephpapplicationsfaster、followthesesteps:1)useopcodecachinglikeopcacheTostoredscriptbytecode.2)最小化abasequeriesecachingingindexing.3)leveragephp7機能forbettercodeefficiency.4)

依存性注入(DI)は、明示的に推移的な依存関係によりPHPコードのテスト可能性を大幅に改善します。 1)DI分離クラスと特定の実装により、テストとメンテナンスが柔軟になります。 2)3つのタイプのうち、コンストラクターは、状態を一貫性に保つために明示的な式依存性を注入します。 3)DIコンテナを使用して複雑な依存関係を管理し、コードの品質と開発効率を向上させます。

DatabaseQueryoptimizationInpholvesseveralstrategESTOEnhancePerformance.1)selectonlynlynlyndorycolumnStoredatedataTransfer.2)useindexingtospeedupdataretrieval.3)revenmecrycachingtostoreres sultsoffrequent queries.4)

phpisusededemingemailsduetoitsbuilt-inmail()functionandsupportiveLibrarieslikephpmailerandswiftmailer.1)usethemail()functionforbasicemails、butithaslimitations.2)emploadforadvancedfeatureSlikelikelivableabableabuses.3)雇用

依存関係に関与(DI)inphpenhancesScodeFlexyandtateabilitybydecouplingessessessessessesses.1)useconstructorinjectiontopassopassopassdepenciesviaConstructors.2)

Pimpleは簡単なプロジェクトに推奨されます。Symfonyの依存関係は、複雑なプロジェクトに推奨されます。 1)Pimpleは、そのシンプルさと柔軟性のため、小さなプロジェクトに適しています。 2)Symfonyの依存関係は、その強力な能力のため、大規模なプロジェクトに適しています。選択するときは、プロジェクトのサイズ、パフォーマンス要件、学習曲線を考慮する必要があります。

依存症(di)inphpisadesignpatternwhereclassdependenciesiesedededed -aittrathertratedinternally、concodemodularityandtestability


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

メモ帳++7.3.1
使いやすく無料のコードエディター

EditPlus 中国語クラック版
サイズが小さく、構文の強調表示、コード プロンプト機能はサポートされていません

MinGW - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

ZendStudio 13.5.1 Mac
強力な PHP 統合開発環境
