PHP尊重验证拉取请求失败Travis,为什么?

时间:2016-08-25 15:42:29

标签: php travis-ci respect-validation

我已经在PHP的Respect Validation中更新了语法,但Travis CI每次都失败,即使我只使用Github编辑器删除了几个字符,然后提交了更改为Pull Request。 https://travis-ci.org/Respect/Validation/builds/155072854

有关为何发生这种情况的任何建议?

1 个答案:

答案 0 :(得分:1)

打开一个平台构建(也称为作业),例如PHP 5.6 one,您将找出错误:

There were 7 failures:
1) Respect\Validation\Rules\EqualsTest::testShouldThrowTheProperExceptionWhenFailure
Failed asserting that exception message '"24" must equal 42' contains '"24" must be equals 42'.
2) Respect\Validation\Rules\KeyValueTest::testShouldCheckWhenDefinedValuesDoesNotMatch
Failed asserting that exception message 'foo must equal "bar"' contains 'foo must be equals "bar"'.
3) /home/travis/build/Respect/Validation/tests/integration/rules/equals_2.phpt
Failed asserting that format description matches text.
--- Expected
+++ Actual
@@ @@
-"test 1234" must be equals "test 123"
+"test 1234" must equal "test 123"
4) /home/travis/build/Respect/Validation/tests/integration/rules/equals_3.phpt
Failed asserting that format description matches text.
--- Expected
+++ Actual
@@ @@
-- "test 1234" must be equals "test 123"
+- "test 1234" must equal "test 123"
5) /home/travis/build/Respect/Validation/tests/integration/rules/equals_4.phpt
Failed asserting that format description matches text.
--- Expected
+++ Actual
@@ @@
-"test 123" must not be equals "test 123"
+"test 123" must not equal "test 123"
6) /home/travis/build/Respect/Validation/tests/integration/rules/equals_5.phpt
Failed asserting that format description matches text.
--- Expected
+++ Actual
@@ @@
-- "test 123" must not be equals "test 123"
+- "test 123" must not equal "test 123"
7) /home/travis/build/Respect/Validation/tests/integration/rules/keyValue_2.phpt
Failed asserting that format description matches text.
--- Expected
+++ Actual
@@ @@
-password must be equals "password_confirmation"
+password must equal "password_confirmation"

您似乎使用equals替换默认模板equal,这会导致失败。有单元测试可以检查行为是否始终相同。 如果要为开源项目创建PR,通常还应该更新或创建测试。

如果你想要,你可以在本地启动测试并检查它是否正常。请查看官方文档中的"Running Tests" section(我提供的内容),了解有关如何启动测试的更多信息。

安装依赖项

composer install

启动测试

在Linux上

vendor/bin/phpunit

在Windows上

vendor\bin\phpunit
相关问题