[Slim4] Add integration tests (#4858)

* [Slim4] Add integration tests

* [Slim4] Remove unnecessary syntax check script

Composer package called "phplint" processes the same syntax check and
even faster. It can use cache when files hasn't been changed.

* [Slim4] Exclude composer.lock from codebase

Travis CI fails, it cannot install dependencies from lock file under
different PHP(7.1.33) version.
This commit is contained in:
Yuriy Belenko 2019-12-23 08:39:49 +05:00 committed by William Cheng
parent a95e3e3684
commit 2949b53820
5 changed files with 32 additions and 2640 deletions

View File

@ -5,7 +5,7 @@ composer.phar
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
composer.lock
# phplint tool creates cache file which is not necessary in a codebase
/.phplint-cache

View File

@ -5,7 +5,7 @@ composer.phar
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
composer.lock
# phplint tool creates cache file which is not necessary in a codebase
/.phplint-cache

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
#!/bin/bash
# a simple script to perform a syntax check on php files using "php -l"
for i in $( find . -name "*.php" ); do
result=`php -l $i | grep "No syntax errors detected"`
exit_status=$?
if [ $exit_status -eq 1 ]; then
echo "Syntax errors with $i"
exit 1;
fi
done

View File

@ -26,6 +26,19 @@
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>bundle-install</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>composer</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>syntax-check</id>
<phase>integration-test</phase>
@ -33,7 +46,23 @@
<goal>exec</goal>
</goals>
<configuration>
<executable>./php_syntax_checker.bash</executable>
<executable>composer</executable>
<arguments>
<argument>phplint</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>bundle-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>composer</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>