草庐IT

dir_test

全部标签

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 - 交响乐 : 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

php - Laravel 黄昏 : how to use in-memory DB for testing

我一直在尝试的是在使用LaravelDusk进行测试时使用内存数据库。这里我们有一个文件,.env.dusk.local,具有以下值。DB_CONNECTION=sqliteDB_DATABASE=:memory:这是浏览器测试文件的片段。classViewOrderTestextendsDuskTestCase{useDatabaseMigrations;/**@test*/publicfunctionuser_can_view_their_order(){$order=factory(Order::class)->create();$this->browse(function(Br

php - localhost/test.php 也可以在 localhost/test/下访问

我的apache-conf有什么问题,为什么在没有扩展名的文件夹路径下也可以访问该文件?我没有设置任何重写规则,也没有.htaccess文件。这是默认的osxapache安装。 最佳答案 Apache的contentnegotiation有一个名为MultiViews的选项这使得没有扩展名的文件可用:TheeffectofMultiViewsisasfollows:iftheserverreceivesarequestfor/some/dir/foo,if/some/dirhasMultiViewsenabled,and/some/

php - __DIR__ VS 使用反射

在Symfony2中,我看到如下代码:if(null===$this->rootDir){$r=new\ReflectionObject($this);$this->rootDir=dirname($r->getFileName());}为什么不直接使用__DIR__?if(null===$this->rootDir){$this->rootDir=__DIR__;}它们有什么区别? 最佳答案 __DIR__返回调用它的文件的目录。Symphony2代码返回定义类的目录,这很可能是一个不同的文件。

php - 消息 : cache_dir must be a directory

大家好,我在使用ZendFramework时遇到了一些问题。我首先收到以下消息:消息:无法确定临时目录,请手动指定cache_dir。我用谷歌搜索并找到这篇文章:ZendFramework:Couldnotdeterminetempdirectory,pleasespecifyacache_dirmanually我读了它,现在当我填写表格时出现以下错误:(我把..放在错误中的任何地方都表示域。)消息:cache_dir必须是一个目录-#0/home/daan/domains/../library/Zend/Cache/Backend/File.php(154):Zend_Cache::

php - Laravel 5.2 测试 : Test is not running

我已经通过终端使用命令创建了一个测试:phpartisanmake:testUserTest现在我想使用以下命令运行测试:供应商/bin/UserTest但它返回bash:vendor/bin/UserTest:没有那个文件或目录PHPunit已安装。我检查过了。我错过了什么吗? 最佳答案 从Laravel根项目目录使用此命令运行测试:vendor/bin/phpunit如果你想运行自定义包测试,使用:vendor/bin/phpunitpackages/name/package/ 关于

php - 无法在 IIS 上设置 upload_tmp_dir

所以我尝试在IIS机器上设置phpupload_tmp_dir设置。我更改了php.ini中的设置,但phpinfo()仍然显示默认文件夹。我查看了IIS_IUSRS的权限,有write,read,modify等我还运行了这个来检查新文件夹是否可写:$filename='C:\inetpub\temp\uploads';if(is_writable($filename)){echo$filename.'iswritable';}else{echo$filename.'isnotwritable';}我更改了max_file_uploads值以测试正在加载的PHP配置是否是最新的,事实确