0

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

关于为什么会发生这种情况的任何建议?

4

1 回答 1

1

打开一个平台构建(也称为作业),例如PHP 5.6 之一,您会发现错误是什么:

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"

似乎您在默认模板中替换为equalsequal这会产生失败。有一些单元测试可以检查行为是否始终相同。如果您想为开源项目创建 PR,通常您还应该更新或创建测试。

如果您愿意,您可以在本地启动测试并检查一切正常。查看官方文档中的“运行测试”部分(我对此做出了贡献),以获取有关如何启动测试的更多信息。

安装依赖项

composer install

启动测试

在 Linux 上

vendor/bin/phpunit

在 Windows 上

vendor\bin\phpunit
于 2016-08-26T08:23:21.403 回答