-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(test): exit code of lime test -- add proof of current behaviour #371
base: master
Are you sure you want to change the base?
Changes from 2 commits
38e6200
04d0339
67168ce
77e027d
4523808
54a52f8
7dccdd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(); | ||
|
||
$test->is(false, true); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(1); | ||
|
||
$test->is(false, true); | ||
$test->is(true, true); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(2); | ||
|
||
$test->is(false, true); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(); | ||
|
||
$test->is(true, true); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
error_reporting(E_USER_ERROR); | ||
|
||
$test = new lime_test(null, [ | ||
'error_reporting' => true, | ||
]); | ||
|
||
trigger_error('some user error message', E_USER_ERROR); | ||
|
||
$test->is(true, true); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(); | ||
|
||
parse_error | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should be excluded from everywhere that parses php files. At this moment php-cs-fixer, but later phpstan, rector etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. php-cs-fixer exclude all files that contain "vendor" on its path. This means that the directory "test/unit/vendor" is ignored. Fixing that, will requires a structural correction, that is out of scope of this PR. @connorhu What can I do on the scope of this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, you are right! For the other tools, it was just a reminder to myself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(); | ||
|
||
throw new LogicException('some exception message'); | ||
|
||
$test->is(true, true); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(1); | ||
|
||
$test->is(true, true); | ||
$test->is(true, true); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(2); | ||
|
||
$test->is(true, true); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test(); | ||
|
||
$test->skip('some skip message'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
require_once __DIR__.'/../../../../bootstrap/unit.php'; | ||
|
||
$test = new lime_test($plan = 2); | ||
|
||
$test->skip('some skip message', $plan); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[PATCH] lime.php not working on windows when there are spaces in php interpreter path
lime.php, line 541
the command fails if the path to php interpreter contains spaces, this obviously prevent all test to run.
In order to work with executables in directories with spaces it should be
but this fails too on windows: system/exec/passthru all fail when more than two arguments are quoted (it seems a php bug but I couldn't find any reference apart from some comments on the system function page)
In order to work on windows it should be written as
this works on windows but still fails on linux (note the double "double quotes": I need to quote the entire command not just the executable and the argument)
The only workaround I could find was something I found on the comments of the system function that is adding a "nop" command call before the quoted command