Skip to content

Commit 56e0009

Browse files
committed
Prepare first command with testing
1 parent a4b9924 commit 56e0009

17 files changed

Lines changed: 756 additions & 746 deletions

.phpunit.result.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:37:"PHPUnit\Runner\DefaultTestResultCache":2230:{a:2:{s:7:"defects";a:9:{s:66:"Scaffold\ExampleCommandsTest::testExampleCommands with data set #0";i:6;s:66:"Scaffold\ExampleCommandsTest::testExampleCommands with data set #1";i:3;s:66:"Scaffold\ExampleCommandsTest::testExampleCommands with data set #2";i:3;s:71:"MWPD\Scaffold\ExampleCommandsTest::testExampleCommands with data set #0";i:4;s:45:"MWPD\Scaffold\TemplateEngineTest::testProcess";i:5;s:73:"MWPD\Scaffold\ScaffoldCommandsTest::testScaffoldCommands with data set #0";i:4;s:73:"MWPD\Scaffold\ScaffoldCommandsTest::testScaffoldCommands with data set #1";i:4;s:73:"MWPD\Scaffold\ScaffoldCommandsTest::testScaffoldCommands with data set #2";i:4;s:99:"MWPD\Scaffold\ScaffoldCommandsTest::testScaffoldCommands with data set "a plugin can be scaffolded"";i:3;}s:5:"times";a:18:{s:66:"Scaffold\ExampleCommandsTest::testExampleCommands with data set #0";d:0.114;s:66:"Scaffold\ExampleCommandsTest::testExampleCommands with data set #1";d:0.069;s:66:"Scaffold\ExampleCommandsTest::testExampleCommands with data set #2";d:0.055;s:50:"Scaffold\ExampleTest::testExample with data set #0";d:0.001;s:50:"Scaffold\ExampleTest::testExample with data set #1";d:0.001;s:50:"Scaffold\ExampleTest::testExample with data set #2";d:0.001;s:71:"MWPD\Scaffold\ExampleCommandsTest::testExampleCommands with data set #0";d:0.177;s:71:"MWPD\Scaffold\ExampleCommandsTest::testExampleCommands with data set #1";d:0.076;s:71:"MWPD\Scaffold\ExampleCommandsTest::testExampleCommands with data set #2";d:0.061;s:55:"MWPD\Scaffold\ExampleTest::testExample with data set #0";d:0.001;s:55:"MWPD\Scaffold\ExampleTest::testExample with data set #1";d:0.001;s:55:"MWPD\Scaffold\ExampleTest::testExample with data set #2";d:0.001;s:45:"MWPD\Scaffold\TemplateEngineTest::testProcess";d:0.001;s:68:"MWPD\Scaffold\TemplateEngine\MustacheTemplateEngineTest::testProcess";d:0.001;s:73:"MWPD\Scaffold\ScaffoldCommandsTest::testScaffoldCommands with data set #0";d:0.069;s:73:"MWPD\Scaffold\ScaffoldCommandsTest::testScaffoldCommands with data set #1";d:0.006;s:73:"MWPD\Scaffold\ScaffoldCommandsTest::testScaffoldCommands with data set #2";d:0.006;s:99:"MWPD\Scaffold\ScaffoldCommandsTest::testScaffoldCommands with data set "a plugin can be scaffolded"";d:0.122;}}}

.scenarios.lock/install

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
SCENARIO=$1
4+
DEPENDENCIES=${2-install}
5+
6+
# Convert the aliases 'highest', 'lowest' and 'lock' to
7+
# the corresponding composer update command to run.
8+
case $DEPENDENCIES in
9+
highest)
10+
UPDATE_COMMAND=update
11+
;;
12+
lowest)
13+
UPDATE_COMMAND='update --prefer-lowest'
14+
;;
15+
lock|default|"")
16+
UPDATE_COMMAND=''
17+
;;
18+
esac
19+
20+
original_name=scenarios
21+
recommended_name=".scenarios.lock"
22+
23+
base="$original_name"
24+
if [ -d "$recommended_name" ] ; then
25+
base="$recommended_name"
26+
fi
27+
28+
# If scenario is not specified, install the lockfile at
29+
# the root of the project.
30+
dir="$base/${SCENARIO}"
31+
if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then
32+
SCENARIO=default
33+
dir=.
34+
fi
35+
36+
# Test to make sure that the selected scenario exists.
37+
if [ ! -d "$dir" ] ; then
38+
echo "Requested scenario '${SCENARIO}' does not exist."
39+
exit 1
40+
fi
41+
42+
echo
43+
echo "::"
44+
echo ":: Switch to ${SCENARIO} scenario"
45+
echo "::"
46+
echo
47+
48+
set -ex
49+
50+
composer -n validate --working-dir=$dir --no-check-all --ansi
51+
52+
if [ ! -z "$UPDATE_COMMAND" ] ; then
53+
composer -n --working-dir=$dir ${UPDATE_COMMAND} --prefer-dist --no-scripts
54+
fi
55+
composer -n --working-dir=$dir install --prefer-dist
56+
57+
# If called from a CI context, print out some extra information about
58+
# what we just installed.
59+
if [[ -n "$CI" ]] ; then
60+
composer -n --working-dir=$dir info
61+
fi

composer.json

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mwpd/scaffold",
3-
"description": "Template project for PHP libraries.",
3+
"description": "Scaffolding tool for the Modern\\WP::development() toolset",
44
"license": "MIT",
55
"authors": [
66
{
@@ -10,25 +10,25 @@
1010
],
1111
"autoload": {
1212
"psr-4": {
13-
"Scaffold\\": "src"
13+
"MWPD\\Scaffold\\": "src"
1414
}
1515
},
1616
"autoload-dev": {
1717
"psr-4": {
18-
"Scaffold\\": "tests/src"
18+
"MWPD\\Scaffold\\Tests\\": "tests/src"
1919
}
2020
},
2121
"require": {
22-
"php": ">=7.1"
22+
"php": ">=7.2"
2323
},
2424
"require-dev": {
25-
"consolidation/Robo": "^1.3",
26-
"knplabs/github-api": "^2.7",
27-
"php-http/guzzle6-adapter": "^1.1",
28-
"phpunit/phpunit": "^6",
29-
"g1a/composer-test-scenarios": "^2",
30-
"satooshi/php-coveralls": "^2",
31-
"squizlabs/php_codesniffer": "^2.8"
25+
"consolidation/robo": "^2",
26+
"g1a/composer-test-scenarios": "^3",
27+
"knplabs/github-api": "^2",
28+
"php-http/guzzle6-adapter": "^2",
29+
"phpunit/phpunit": "^8",
30+
"php-coveralls/php-coveralls": "^2",
31+
"squizlabs/php_codesniffer": "^3"
3232
},
3333
"scripts": {
3434
"phar:install-tools": [
@@ -52,7 +52,6 @@
5252
"release": [
5353
"release VERSION"
5454
],
55-
"scenario": "scenarios/install",
5655
"post-update-cmd": [
5756
"dependency-licenses"
5857
]
@@ -61,12 +60,12 @@
6160
"optimize-autoloader": true,
6261
"sort-packages": true,
6362
"platform": {
64-
"php": "7.1.13"
63+
"php": "7.2"
6564
}
6665
},
6766
"extra": {
6867
"branch-alias": {
6968
"dev-master": "1.x-dev"
7069
}
7170
}
72-
}
71+
}

0 commit comments

Comments
 (0)