小编Lau*_*a_E的帖子

php代码嗅探器什么都不返回……我的代码是标准的吗?

我有一个 Laravel 应用程序(用 composer 创建),我试图确保它符合 PHP 编码标准(级别 PSR-1)。我跑:

$ phpcs --standard=PSR1 my_app/
Run Code Online (Sandbox Code Playgroud)

并在几秒钟内返回一个新的、空的、随时可用的命令行:

$
Run Code Online (Sandbox Code Playgroud)

这是否意味着我的代码符合 PSR-1 中的所有要求和标准?它只做同样的事情:

$ phpcs my_app/
$ phpcs --standard=PEAR my_app/
$ phpcs --standard=PSR1 --report=summary lauras_app/
Run Code Online (Sandbox Code Playgroud)

我只想确保如果命令什么都不返回,那意味着我的代码是标准的。谢谢!

php pear code-standards phpcodesniffer psr-1

5
推荐指数
1
解决办法
1401
查看次数

Behat测试"然后我应该看到Laravel 5"在laravel应用程序中失败

我有OS El Capitan的Macbook.在我的新Laravel应用程序(由...创建 $ composer create-project laravel/laravel my_app)中,我输入:

$ php artisan serve
Run Code Online (Sandbox Code Playgroud)

在localhost:8000上的浏览器(Safari或Chrome)中,我在网页上成功看到黑色文本"Laravel 5".

我有一个hometest.feature文件的功能/看起来像:

Feature:
  In order to prove that Behat works as intended
  We want to test the home page for a phrase
  Scenario: Root Test
    When I am on the homepage
    Then I should see "Laravel 5"
Run Code Online (Sandbox Code Playgroud)

我有一个/features/bootstrap/FeaturesContext.php文件,它看起来像:

<?php

use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;

/**
 * Defines application features from the specific context.
 */
class FeatureContext extends Behat\MinkExtension\Context\MinkContext implements Context, SnippetAcceptingContext
{
    /** …
Run Code Online (Sandbox Code Playgroud)

php bdd behat laravel laravel-5

1
推荐指数
1
解决办法
605
查看次数

标签 统计

php ×2

bdd ×1

behat ×1

code-standards ×1

laravel ×1

laravel-5 ×1

pear ×1

phpcodesniffer ×1

psr-1 ×1