1. 云栖社区>
  2. PHP教程>
  3. 正文

Matt Stauffer: Environment specific variables in Laravel's testing environment

作者:用户 来源:互联网 时间:2017-12-01 17:54:19

Matt Stauffer: Environment specific variables in Laravel's testing environment - 摘要: 本文讲的是Matt Stauffer: Environment specific variables in Laravel's testing environment, Matt Staufferhas a quick post to his site showing how you can set up and use environment specific variables in L

Matt Staufferhas a quick post to his site showing how you can set up and use environment specific variables in Laravel, specifically for your testing environment.

In Laravel, it's easy to set environment variables that are specific to your testing environment. Just edit your phpunit.xml file and set them as entries in the block [...] but what if you find yourself needing to exclude these values from version control?

He talks about the projecthe's working on and its integration with Twilio. He need to write some tests for a class that connected to the Twilio service but wanted an easy way to swap out the production credentials with the Twilio test ones. Instead of checking in the test credentials, he dropped them into his .envsettings file, one specific to the test environment.

以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索,以便于您获取更多的相关知识。