草庐IT

test_client

全部标签

php - 如何从Google OAuth2 PHP Client获取用户国家和时区信息

我正在使用PHPGoogleAPIClientLibrary使用OAuth2从Google帐户检索用户信息。然而,尽管Google'sdocumentationstates,我似乎无法访问用户的国家/地区或时区信息,即使token已成功返回并且所有其他信息都可以从userinfo.profile范围。我使用了int继承人库提供的示例代码here如果我在该文件的第49行var_dump($user)得到以下输出(出于隐私考虑进行了编辑):array(10){["id"]=>string(21)"123"/*Redacted*/["email"]=>string(13)"XXX@gmail

php - aws s3Client PutObject 访问被拒绝,但 Cyber​​Duck 可以成功 PutObject

我面临着一个关于S3存储桶策略的谜团,它阻止我的PhpS3Client来自PutObject。我得到的错误是:Errorexecuting"PutObject"on"https://s3.amazonaws.com/reusable-system-dev/b1e42024e33d62b852d3c94c85f68c72.jpeg";AWSHTTPerror:Clienterrorresponse[url]https://s3.amazonaws.com/reusable-system-dev/b1e42024e33d62b852d3c94c85f68c72.jpeg[statuscod

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 - 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 - 在 PHP : An exception has been raised as a result of client data 中调试 SOAP 调用

我正在使用UPSAPI,但在调试时遇到困难。我得到以下堆栈跟踪:DetailsType:SoapFaultMessage:Anexceptionhasbeenraisedasaresultofclientdata.File:/Users/shawn/Documents/work/sites/Wingspan/kaleco/lib/SixString/Utilities/Ups.phpLine:161Trace#0/Users/shawn/Documents/work/sites/Wingspan/kaleco/lib/SixString/Utilities/Ups.php(161):S

php - 适用于 PHP 的 Google Identity Toolkit API 返回 INVALID_CLIENT

我正在尝试让GoogleIdentityToolkitAPI为基于PHP的应用程序工作。我一直在关注Google提供的快速入门指南:https://developers.google.com/identity/toolkit/web/quickstart/php我完全按照这些步骤操作(并检查并仔细检查)。登录按钮出现在index.php页面上。单击此重定向到widget.php页面。我可以选择要登录的帐户,然后当返回到成功登录页面(再次是index.php)时,我收到以下错误消息:Fatalerror:Uncaughtexception'Google_Auth_Exception'wi

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