-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new config data when Infection has been executed at the first time
- Loading branch information
Showing
10 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/infection.json* |
11 changes: 11 additions & 0 deletions
11
tests/Fixtures/e2e/Initial_Configuration/Initial_Configuration/SourceClass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Initial_Configuration; | ||
|
||
class SourceClass | ||
{ | ||
public function hello(): string | ||
{ | ||
return 'hello'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"require-dev": { | ||
"phpunit/phpunit": "^6.5" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Initial_Configuration\\": "Initial_Configuration/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-0": { | ||
"Initial_Configuration": "tests/" | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
tests/Fixtures/e2e/Initial_Configuration/do_configure.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env expect | ||
set timeout 20 | ||
eval spawn $env(INFECTION) | ||
|
||
proc configure { input value } { | ||
expect $input { | ||
send $value | ||
} timeout { | ||
send_user "Test failed\n" | ||
exit 1 | ||
} | ||
} | ||
|
||
configure "directories do you want to include" "1\r" | ||
configure "Any directories to exclude from" "\r" | ||
configure "timeout in seconds" "\r" | ||
configure "text log file?" "\r" | ||
|
||
expect { | ||
"does not exist" { | ||
close | ||
exit 1 | ||
} | ||
"Please note that some mutants will inevitably be harmless" | ||
} | ||
|
||
send_user "\nTest succeeded!\n" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Escaped mutants: | ||
================ | ||
|
||
Timed Out mutants: | ||
================== | ||
|
||
Not Covered mutants: | ||
==================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="./vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">Initial_Configuration/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
if test ! -f "$(which expect)"; then | ||
test -x $(which tput) && tput setaf 1 # red | ||
echo "Please install expect; it is readily available from apt and brew" | ||
exit 1; | ||
fi | ||
|
||
cd $(dirname $0) | ||
rm -v -f infection.json.dist infection.log | ||
|
||
set -e | ||
|
||
if [ "$PHPDBG" = "1" ] | ||
then | ||
INFECTION="phpdbg -qrr ../../../../bin/infection" | ||
else | ||
INFECTION="php ../../../../bin/infection" | ||
fi | ||
export INFECTION | ||
|
||
./do_configure.expect | ||
|
||
trap 'echo Final check failed: $(tail -n+$LINENO $0 | head -n1)' ERR | ||
|
||
test -f infection.json.dist | ||
test -f infection.log | ||
diff -u expected.log infection.log |
13 changes: 13 additions & 0 deletions
13
tests/Fixtures/e2e/Initial_Configuration/tests/Initial_Configuration_Test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
use Initial_Configuration\SourceClass; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class Initial_Configuration_Test extends TestCase | ||
{ | ||
public function test_hello() | ||
{ | ||
$sourceClass = new SourceClass(); | ||
$this->assertSame('hello', $sourceClass->hello()); | ||
} | ||
} |