Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fardjad/f912c00f65735c4a8e3a to your computer and use it in GitHub Desktop.
Save fardjad/f912c00f65735c4a8e3a to your computer and use it in GitHub Desktop.
[PHP sample with Grunt, Composer, PHPUnit, and continuos testing] #php #grunt #composer #phpunit
# Created by https://www.gitignore.io/api/composer,windows,osx,linux,node,grunt,osx
### Composer ###
composer.phar
/vendor/
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Linux ###
*~
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
### Node ###
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
### grunt ###
# Grunt usually compiles files inside this directory
dist/
# Grunt usually preprocesses files such as coffeescript, compass... inside the .tmp directory
.tmp/
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
{
"name": "fardjad/noname",
"description": "",
"license": "MIT",
"keywords": [
],
"authors": [
{
"name": "Fardjad Davari",
"email": "public@fardjad.com"
}
],
"type": "library",
"require": {
},
"require-dev": {
"phpunit/phpunit": "^5.1"
},
"autoload": {
"psr-4": {
"Fardjad\\NoName\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Fardjad\\NoName\\": "test"
}
}
}
module.exports = function (grunt) {
var path = require('path');
grunt.initConfig({
shell: {
phpunit: {
file: '',
command: function () {
return 'vendor/bin/phpunit test'.replace(/\//g, path.sep);
}
}
},
esteWatch: {
options: {
dirs: [
'src/**/',
'test/**/',
]
},
php: function (filePath) {
return ['clear', 'shell:phpunit'];
}
}
});
grunt.loadNpmTasks('grunt-este-watch');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-clear');
grunt.registerTask('ctest', ['clear', 'shell:phpunit', 'esteWatch:php']);
grunt.registerTask('test', ['shell:phpunit']);
};
{
"name": "noname",
"version": "1.0.0",
"description": "",
"directories": {
"test": "test"
},
"scripts": {
"test": "grunt test"
},
"author": "Fardjad Davari <public@fardjad.com>",
"license": "MIT",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-este-watch": "^0.1.18",
"grunt-shell": "^1.1.2",
"grunt-clear": "^0.2.1"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestSize="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutTodoAnnotatedTests="true"
checkForUnintentionallyCoveredCode="true"
forceCoversAnnotation="true">
</phpunit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment