草庐IT

tests_require

全部标签

php - Yii Framework testing with PHPUnit and Selenium 错误/警告

我正在使用这本书:“使用Yii1.1和PHP5进行敏捷Web应用程序开发”来开始使用Yii。在设置我的TDD环境并运行我的第一个测试时,弹出以下警告:sl@cker:/var/www/demo/protected/tests$phpunitfunctional/SiteTest.phpPHPUnit3.6.12bySebastianBergmann.Configurationreadfrom/var/www/demo/protected/tests/phpunit.xmlPHPWarning:include(SiteTest:Firefox.php):failedtoopenstrea

php - 如何从不同的目录中 require_once?

我试图从不同文件夹中的php文件中获取我的“库”文件,但在尝试从子文件夹访问它们时出现错误。比如我有这样一个目录:+home-file1.php++subfolder-file2.php++libraries-code_generator.php-database_library.phpcode_generator.php还依赖于其他库:(LINE25)require_once(realpath("./libraries/database_library.php"));//thisworksfinewhencalledfromfile1.php,butnotfromfile2.php我

php - Laravel 4 PHP fatal error : Class 'Illuminate\Foundation\Testing\TestCase' not found

当我使用Laravel4运行phpunit时出现以下错误。PHPFatalerror:Class'Illuminate\Foundation\Testing\TestCase'notfoundinComposer.json"require":{"laravel/framework":"4.0.*","phpunit/phpunit":"3.7.*"},应用.php'Illuminate\Foundation\Testing\TestCase'我应该做什么? 最佳答案 看起来自动加载不包含新要求。请务必运行composerupdate

php - PHP 的 Google API 客户端中的 required_once 问题

我一直在尝试在我的php脚本文件中导入/包含文件,但不知何故它不起作用。我知道这个require_once问题已经被问了很多次[1.require_oncewithsubfolders,2.require_once()cantfindtheincludepath,3.Usingrequire_onceforupdirectorynotworking]但他们似乎都不适合我。下图将清楚地说明我要做什么:我的尝试和错误:尝试1require_once(__DIR__.'GoogleClientApi/src/Google/Service/Analytics.php');echo'Hey1';

php - 交响乐 : Testing email sending in command

早上好。我想在我的Symfony命令中测试发送电子邮件。我的电子邮件是通过\Swift_Mailer发送的$this->mailer->send($message);我尝试使用这个:http://symfony.com/doc/current/cookbook/email/testing.html但是$this->client->getProfile()和SymfonyResponse在Symfony命令中不可用。Argument1passedtoSymfony\Component\HttpKernel\Profiler\Profiler::loadProfileFromRespons

php - 为什么 $$var ['namedIndex' ] = 'test' 不起作用?

在PHP中你可以$var='title';$$var='mynewtitle';而且效果很好。但是当您尝试将它与数组一起使用时,它不起作用并且没有报告任何错误。$var='title';$$var['en']='myenglishtitle';$var='description';$$var['en']='myenglishdescription';感谢帮助[编辑]如果我这样做$$var=array();array_push($$var,'test');它工作并输出title[0]='test';但我真的需要命名索引:/ 最佳答案

php - in_array 组合值 ('test' ,'value' )

我正在尝试将in_array或类似的东西用于关联数组或更复杂的数组。这是普通的in_arrayin_array('test',array('test','exists'));//truein_array('test',array('not','exists'));//false我要搜索的是对,例如“test”和“value”的组合。我可以根据需要将要搜索的组合设置为array('test','value')或'test'=>'value'。但是,如果要搜索的数组是,我该如何进行搜索?array('test'=>'value','exists'=>'here');orarray(arra

安装mySQL报错 Requirement:Visual Studio version 2015,2017 or 2019 must be installed.

@创建于:2022.10.19@修改于:2022.10.191、报错信息按照mysql安装教程【安装版】,按照MySQL。出现如下错误。RequirementDetailsThisisamanualrequirement.Youcanattempttoresolvetherequirementusingtheinformationprovided.Whendone,youcanpresstheCheckbuttontoseeiftherequirmenthasbeenmet.Requirement:VisualStudioversion2015,2017or2019mustbeinstalle

php - 我应该在 HTML 中的什么地方放置 PHP include/require 语句?

我在一个文件中创建了一个PHP类,现在我想在我的HTML页面中使用它。我应该把require放在哪里?或includeHTML页面中的语句?在HTML的开头或结尾加载它是否有性能差异,还是根本没有差异?应该是早于PHP脚本,所以如果类太长,字符集不会有任何问题吗?例子:NothingShowClientList();?> 最佳答案 您必须将它放在依赖于它的代码被调用之前的任何地方。否则,您放置它的位置不会影响性能。许多应用程序通常将它们所依赖的文件包含在文件的顶部,因为这样可以更轻松地跟踪您正在使用的内容。

php - 如何停止 PHP Composer 自动加载 require-dev 库?

我仅将PHPUnit用于测试和开发,我不希望我的应用程序在生产服务器中自动加载它们,这可能吗?"require-dev":{"phpunit/phpunit":"4.2.*",..我看到文件“autoload_classmap.php”包含诸如...的行returnarray('File_Iterator'=>$vendorDir.'/phpunit/php-file-iterator/File/Iterator.php','File_Iterator_Facade'=>$vendorDir.'/phpunit/php-file-iterator/File/Iterator/Facad