Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates-3449631
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
automatic_updates-3449631
Commits
e447bb06
Commit
e447bb06
authored
2 years ago
by
Travis Carden
Committed by
Adam G-H
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3309270
by TravisCarden: Add Composer command for running tests
parent
438237fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
composer.json
+7
-2
7 additions, 2 deletions
composer.json
scripts/phpcbf.sh
+2
-2
2 additions, 2 deletions
scripts/phpcbf.sh
scripts/phpcs.sh
+1
-1
1 addition, 1 deletion
scripts/phpcs.sh
scripts/phpunit.sh
+43
-0
43 additions, 0 deletions
scripts/phpunit.sh
with
53 additions
and
5 deletions
composer.json
+
7
−
2
View file @
e447bb06
...
...
@@ -27,10 +27,15 @@
},
"scripts"
:
{
"phpcbf"
:
"scripts/phpcbf.sh"
,
"phpcs"
:
"scripts/phpcs.sh"
"phpcs"
:
"scripts/phpcs.sh"
,
"test"
:
[
"Composer
\\
Config::disableProcessTimeout"
,
"scripts/phpunit.sh"
]
},
"scripts-descriptions"
:
{
"phpcbf"
:
"Automatically fixes standards violations where possible."
,
"phpcs"
:
"Checks code for standards compliance."
"phpcs"
:
"Checks code for standards compliance."
,
"test"
:
"Runs PHPUnit tests."
}
}
This diff is collapsed.
Click to expand it.
scripts/phpcbf.sh
+
2
−
2
View file @
e447bb06
#!/usr/bin/env bash
# NAME
# phpcbf.sh - Automatically fixe standards violations where possible.
# phpcbf.sh - Automatically fixe
s
standards violations where possible.
#
# SYNOPSIS
# bash phpcbf.sh
...
...
@@ -15,7 +15,7 @@
cd
"
$(
dirname
"
$0
"
)
"
||
exit
0
;
#
# Find PHPCBF in Drupal core. Check up to three directories up.
# Find PHPCBF in Drupal core. Check up to three directories up.
DIR
=
$(
pwd
)
for
i
in
{
0..3
}
;
do
DIR
=
$(
dirname
"
$DIR
"
)
...
...
This diff is collapsed.
Click to expand it.
scripts/phpcs.sh
+
1
−
1
View file @
e447bb06
...
...
@@ -15,7 +15,7 @@
cd
"
$(
dirname
"
$0
"
)
"
||
exit
0
;
#
# Find PHPCS in Drupal core. Check up to three directories up.
# Find PHPCS in Drupal core. Check up to three directories up.
DIR
=
$(
pwd
)
for
i
in
{
0..3
}
;
do
DIR
=
$(
dirname
"
$DIR
"
)
...
...
This diff is collapsed.
Click to expand it.
scripts/phpunit.sh
0 → 100755
+
43
−
0
View file @
e447bb06
#!/usr/bin/env bash
# NAME
# phpunit.sh - Runs PHPUnit tests.
#
# SYNOPSIS
# bash phpunit.sh
#
# DESCRIPTION
# Run all Automatic Updates PHPUnit tests.
#
# It is assumed that this module is inside a Drupal core installation, in
# modules or modules/contrib. See setup_local_dev.sh.
cd
"
$(
dirname
"
$0
"
)
"
||
exit
0
;
# Find PHPUnit in Drupal core. Check up to three directories up.
DIR
=
$(
pwd
)
for
i
in
{
0..3
}
;
do
DIR
=
$(
dirname
"
$DIR
"
)
PHPUNIT_BIN
=
"
$DIR
/vendor/bin/phpunit"
PHPUNIT_CONFIG
=
"
$DIR
/core/phpunit.xml"
if
test
-f
"
$PHPUNIT_BIN
"
;
then
break
fi
done
# Exit if PHPUnit can't be found.
if
test
!
-f
"
$PHPUNIT_BIN
"
;
then
echo
"Could not find PHPUnit. Are you inside a Drupal site's 'modules' directory?"
exit
1
fi
# Exit if PHPUnit can't be found.
if
test
!
-f
"
$PHPUNIT_CONFIG
"
;
then
echo
"Could not find PHPUnit configuration. See setup_local_dev.sh."
exit
1
fi
# Run PHPUnit on the module directory.
php
"
$PHPUNIT_BIN
"
\
-c
"
$PHPUNIT_CONFIG
"
\
"
$(
cd
..
&&
pwd
)
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment