Skip to content

Commit b15be0f

Browse files
committed
no message
1 parent 9d0bd64 commit b15be0f

File tree

9 files changed

+3265
-16
lines changed

9 files changed

+3265
-16
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ matrix:
3535
# Composer package installation
3636
install:
3737
# Install coveralls.phar
38-
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
39-
- chmod +x coveralls.phar
40-
- php coveralls.phar --version
38+
#- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
39+
#- chmod +x coveralls.phar
40+
#- php coveralls.phar --version
4141

4242
before_script:
4343
- bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
@@ -48,10 +48,10 @@ before_script:
4848
- ls -al
4949

5050
script:
51-
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
51+
- vendor/bin/codecept run wpunit
5252

5353
after_success:
54-
- travis_retry php coveralls.phar -v
54+
# - travis_retry php coveralls.phar -v
5555

5656
cache:
5757
directories:

bin/install-wp-tests.sh

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ DB_HOST=${4-localhost}
1212
WP_VERSION=${5-latest}
1313
SKIP_DB_CREATE=${6-false}
1414

15-
WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wp-graphql-jwt-authentication/wordpress-tests-lib}
16-
WP_CORE_DIR=${WP_CORE_DIR-/tmp/wp-graphql-jwt-authentication/wordpress/}
15+
PLUGIN_DIR=$(pwd)
16+
WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wp-graphql-jwt-authentication}
17+
WP_CORE_DIR=${WP_CORE_DIR-/tmp/wp-graphql-jwt-authentication/}
18+
DB_SERVE_NAME=${DB_SERVE_NAME-wpgraphql_jwt_auth_serve}
1719

1820
download() {
1921
if [ `which curl` ]; then
@@ -118,16 +120,53 @@ install_db() {
118120
fi
119121
fi
120122

121-
# create database
122-
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
123+
124+
RESULT=`mysql -u $DB_USER --password="$DB_PASS" --skip-column-names -e "SHOW DATABASES LIKE '$DB_NAME'"`
125+
if [ "$RESULT" != $DB_NAME ]; then
126+
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
127+
fi
128+
129+
RESULT_2=`mysql -u $DB_USER --password="$DB_PASS" --skip-column-names -e "SHOW DATABASES LIKE '$DB_SERVE_NAME'"`
130+
if [ "$RESULT_2" != $DB_SERVE_NAME ]; then
131+
mysqladmin create $DB_SERVE_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
132+
fi
133+
134+
}
135+
136+
configure_wordpress() {
137+
138+
cd $WP_CORE_DIR
139+
wp config create --dbname="$DB_SERVE_NAME" --dbuser=root --dbpass="$DB_PASS" --dbhost="$DB_HOST" --skip-check --force=true
140+
wp core install --url=wpgraphql.test --title="WPGraphQL Tests" --admin_user=admin --admin_password=password [email protected]
141+
wp rewrite structure '/%year%/%monthnum%/%postname%/'
123142
}
124143

125144
install_wpgraphql() {
126145
echo "Cloning WPGraphQL"
127146
git clone https://github.com/wp-graphql/wp-graphql.git $WP_CORE_DIR/wp-content/plugins/wp-graphql
128147
}
129148

149+
activate_plugins() {
150+
151+
# Add this repo as a plugin to the repo
152+
ln -s $PLUGIN_DIR $WP_CORE_DIR/wp-content/plugins/wp-graphql-jwt-authentication
153+
154+
cd $WP_CORE_DIR
155+
156+
# activate the plugin
157+
wp plugin activate wp-graphql
158+
wp plugin activate wp-graphql-jwt-authentication
159+
160+
# Flush the permalinks
161+
wp rewrite flush
162+
163+
# Export the db for codeception to use
164+
wp db export $PLUGIN_DIR/tests/_data/dump.sql
165+
}
166+
130167
install_wp
131168
install_test_suite
132169
install_db
170+
configure_wordpress
133171
install_wpgraphql
172+
activate_plugins

tests/functional.suite.dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ modules:
3333
tablePrefix: 'wp_'
3434
WPLoader:
3535
loadOnly: true
36-
wpRootFolder: /tmp/wordpress
36+
wpRootFolder: /tmp/wp-graphql-jwt-authentication
3737
dbName: wpgraphql_jwt_auth_serve
3838
dbHost: 127.0.0.1
3939
dbUser: root
4040
dbPassword: ''
41-
configFile: "tests/_data/config.php"
41+
configFile: "tests/_data/config.php"

tests/wpunit.suite.dist.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ modules:
99
- \Helper\Wpunit
1010
config:
1111
WPLoader:
12-
wpRootFolder: "/tmp/wordpress"
13-
dbName: "wpgraphql_jwt_auth_test"
12+
wpRootFolder: "/tmp/wp-graphql-jwt-authentication"
13+
dbName: "wptests"
1414
dbHost: "127.0.0.1"
1515
dbUser: "root"
1616
dbPassword: ""
1717
tablePrefix: "wp_"
1818
domain: "wp.localhost"
1919
adminEmail: "[email protected]"
20-
title: "Test"
20+
title: "Test"
2121
plugins: ['wp-graphql/wp-graphql.php', 'wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php']
2222
activatePlugins: ['wp-graphql/wp-graphql.php', 'wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php']
2323
configFile: "tests/_data/config.php"

vendor/composer/ClassLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ private function findFileWithExtension($class, $ext)
379379
$subPath = substr($subPath, 0, $lastPos);
380380
$search = $subPath.'\\';
381381
if (isset($this->prefixDirsPsr4[$search])) {
382+
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
382383
foreach ($this->prefixDirsPsr4[$search] as $dir) {
383-
$length = $this->prefixLengthsPsr4[$first][$search];
384-
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
384+
if (file_exists($file = $dir . $pathEnd)) {
385385
return $file;
386386
}
387387
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?php
2+
3+
// autoload_commands_classmap.php @generated by Composer
4+
5+
$vendorDir = dirname(dirname(__FILE__));
6+
$baseDir = dirname($vendorDir);
7+
8+
return array(
9+
'CLI_Command' => $vendorDir . '/wp-cli/wp-cli/php/commands/src/CLI_Command.php',
10+
'Cache_Command' => $vendorDir . '/wp-cli/cache-command/src/Cache_Command.php',
11+
'Capabilities_Command' => $vendorDir . '/wp-cli/role-command/src/Capabilities_Command.php',
12+
'Checksum_Command' => $vendorDir . '/wp-cli/checksum-command/src/Checksum_Command.php',
13+
'Comment_Command' => $vendorDir . '/wp-cli/entity-command/src/Comment_Command.php',
14+
'Comment_Meta_Command' => $vendorDir . '/wp-cli/entity-command/src/Comment_Meta_Command.php',
15+
'Config_Command' => $vendorDir . '/wp-cli/config-command/src/Config_Command.php',
16+
'Core_Command' => $vendorDir . '/wp-cli/core-command/src/Core_Command.php',
17+
'Core_Language_Command' => $vendorDir . '/wp-cli/language-command/src/Core_Language_Command.php',
18+
'Cron_Command' => $vendorDir . '/wp-cli/cron-command/src/Cron_Command.php',
19+
'Cron_Event_Command' => $vendorDir . '/wp-cli/cron-command/src/Cron_Event_Command.php',
20+
'Cron_Schedule_Command' => $vendorDir . '/wp-cli/cron-command/src/Cron_Schedule_Command.php',
21+
'DB_Command' => $vendorDir . '/wp-cli/db-command/src/DB_Command.php',
22+
'EvalFile_Command' => $vendorDir . '/wp-cli/eval-command/src/EvalFile_Command.php',
23+
'Eval_Command' => $vendorDir . '/wp-cli/eval-command/src/Eval_Command.php',
24+
'Export_Command' => $vendorDir . '/wp-cli/export-command/src/Export_Command.php',
25+
'Import_Command' => $vendorDir . '/wp-cli/import-command/src/Import_Command.php',
26+
'Language_Namespace' => $vendorDir . '/wp-cli/language-command/src/Language_Namespace.php',
27+
'Media_Command' => $vendorDir . '/wp-cli/media-command/src/Media_Command.php',
28+
'Menu_Command' => $vendorDir . '/wp-cli/entity-command/src/Menu_Command.php',
29+
'Menu_Item_Command' => $vendorDir . '/wp-cli/entity-command/src/Menu_Item_Command.php',
30+
'Menu_Location_Command' => $vendorDir . '/wp-cli/entity-command/src/Menu_Location_Command.php',
31+
'Network_Meta_Command' => $vendorDir . '/wp-cli/entity-command/src/Network_Meta_Command.php',
32+
'Network_Namespace' => $vendorDir . '/wp-cli/entity-command/src/Network_Namespace.php',
33+
'Option_Command' => $vendorDir . '/wp-cli/entity-command/src/Option_Command.php',
34+
'Package_Command' => $vendorDir . '/wp-cli/package-command/src/Package_Command.php',
35+
'Plugin_Command' => $vendorDir . '/wp-cli/extension-command/src/Plugin_Command.php',
36+
'Post_Command' => $vendorDir . '/wp-cli/entity-command/src/Post_Command.php',
37+
'Post_Meta_Command' => $vendorDir . '/wp-cli/entity-command/src/Post_Meta_Command.php',
38+
'Post_Term_Command' => $vendorDir . '/wp-cli/entity-command/src/Post_Term_Command.php',
39+
'Post_Type_Command' => $vendorDir . '/wp-cli/entity-command/src/Post_Type_Command.php',
40+
'Rewrite_Command' => $vendorDir . '/wp-cli/rewrite-command/src/Rewrite_Command.php',
41+
'Role_Command' => $vendorDir . '/wp-cli/role-command/src/Role_Command.php',
42+
'Scaffold_Command' => $vendorDir . '/wp-cli/scaffold-command/src/Scaffold_Command.php',
43+
'Search_Replace_Command' => $vendorDir . '/wp-cli/search-replace-command/src/Search_Replace_Command.php',
44+
'Server_Command' => $vendorDir . '/wp-cli/server-command/src/Server_Command.php',
45+
'Shell_Command' => $vendorDir . '/wp-cli/shell-command/src/Shell_Command.php',
46+
'Sidebar_Command' => $vendorDir . '/wp-cli/widget-command/src/Sidebar_Command.php',
47+
'Site_Command' => $vendorDir . '/wp-cli/entity-command/src/Site_Command.php',
48+
'Site_Option_Command' => $vendorDir . '/wp-cli/entity-command/src/Site_Option_Command.php',
49+
'Super_Admin_Command' => $vendorDir . '/wp-cli/super-admin-command/src/Super_Admin_Command.php',
50+
'Taxonomy_Command' => $vendorDir . '/wp-cli/entity-command/src/Taxonomy_Command.php',
51+
'Term_Command' => $vendorDir . '/wp-cli/entity-command/src/Term_Command.php',
52+
'Term_Meta_Command' => $vendorDir . '/wp-cli/entity-command/src/Term_Meta_Command.php',
53+
'Theme_Command' => $vendorDir . '/wp-cli/extension-command/src/Theme_Command.php',
54+
'Theme_Mod_Command' => $vendorDir . '/wp-cli/extension-command/src/Theme_Mod_Command.php',
55+
'Transient_Command' => $vendorDir . '/wp-cli/cache-command/src/Transient_Command.php',
56+
'User_Command' => $vendorDir . '/wp-cli/entity-command/src/User_Command.php',
57+
'User_Meta_Command' => $vendorDir . '/wp-cli/entity-command/src/User_Meta_Command.php',
58+
'User_Session_Command' => $vendorDir . '/wp-cli/entity-command/src/User_Session_Command.php',
59+
'User_Term_Command' => $vendorDir . '/wp-cli/entity-command/src/User_Term_Command.php',
60+
'WP_CLI\\CommandWithDBObject' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/CommandWithDBObject.php',
61+
'WP_CLI\\CommandWithMeta' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/CommandWithMeta.php',
62+
'WP_CLI\\CommandWithTerms' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/CommandWithTerms.php',
63+
'WP_CLI\\CommandWithTranslation' => $vendorDir . '/wp-cli/language-command/src/WP_CLI/CommandWithTranslation.php',
64+
'WP_CLI\\CommandWithUpgrade' => $vendorDir . '/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php',
65+
'WP_CLI\\CoreUpgrader' => $vendorDir . '/wp-cli/core-command/src/WP_CLI/CoreUpgrader.php',
66+
'WP_CLI\\DestructivePluginUpgrader' => $vendorDir . '/wp-cli/extension-command/src/WP_CLI/DestructivePluginUpgrader.php',
67+
'WP_CLI\\DestructiveThemeUpgrader' => $vendorDir . '/wp-cli/extension-command/src/WP_CLI/DestructiveThemeUpgrader.php',
68+
'WP_CLI\\Entity\\NonExistentKeyException' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/Entity/NonExistentKeyException.php',
69+
'WP_CLI\\Entity\\RecursiveDataStructureTraverser' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/Entity/RecursiveDataStructureTraverser.php',
70+
'WP_CLI\\Entity\\Utils' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/Entity/Utils.php',
71+
'WP_CLI\\Fetchers\\Comment' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/Fetchers/Comment.php',
72+
'WP_CLI\\Fetchers\\Plugin' => $vendorDir . '/wp-cli/extension-command/src/WP_CLI/Fetchers/Plugin.php',
73+
'WP_CLI\\Fetchers\\Post' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/Fetchers/Post.php',
74+
'WP_CLI\\Fetchers\\Site' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/Fetchers/Site.php',
75+
'WP_CLI\\Fetchers\\Theme' => $vendorDir . '/wp-cli/extension-command/src/WP_CLI/Fetchers/Theme.php',
76+
'WP_CLI\\Fetchers\\User' => $vendorDir . '/wp-cli/entity-command/src/WP_CLI/Fetchers/User.php',
77+
'WP_CLI\\Inflector' => $vendorDir . '/wp-cli/scaffold-command/src/WP_CLI/Inflector.php',
78+
'WP_CLI\\JsonManipulator' => $vendorDir . '/wp-cli/package-command/src/WP_CLI/JsonManipulator.php',
79+
'WP_CLI\\LanguagePackUpgrader' => $vendorDir . '/wp-cli/language-command/src/WP_CLI/LanguagePackUpgrader.php',
80+
'WP_CLI\\NonDestructiveCoreUpgrader' => $vendorDir . '/wp-cli/core-command/src/WP_CLI/NonDestructiveCoreUpgrader.php',
81+
'WP_CLI\\REPL' => $vendorDir . '/wp-cli/shell-command/src/WP_CLI/REPL.php',
82+
'WP_CLI\\SearchReplacer' => $vendorDir . '/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php',
83+
'WP_Export_Base_Writer' => $vendorDir . '/wp-cli/export-command/src/WP_Export_Base_Writer.php',
84+
'WP_Export_Exception' => $vendorDir . '/wp-cli/export-command/src/WP_Export_Exception.php',
85+
'WP_Export_File_Writer' => $vendorDir . '/wp-cli/export-command/src/WP_Export_File_Writer.php',
86+
'WP_Export_Oxymel' => $vendorDir . '/wp-cli/export-command/src/WP_Export_Oxymel.php',
87+
'WP_Export_Query' => $vendorDir . '/wp-cli/export-command/src/WP_Export_Query.php',
88+
'WP_Export_Returner' => $vendorDir . '/wp-cli/export-command/src/WP_Export_Returner.php',
89+
'WP_Export_Split_Files_Writer' => $vendorDir . '/wp-cli/export-command/src/WP_Export_Split_Files_Writer.php',
90+
'WP_Export_Stdout_Writer' => $vendorDir . '/wp-cli/export-command/src/WP_Export_Stdout_Writer.php',
91+
'WP_Export_Term_Exception' => $vendorDir . '/wp-cli/export-command/src/WP_Export_Term_Exception.php',
92+
'WP_Export_WXR_Formatter' => $vendorDir . '/wp-cli/export-command/src/WP_Export_WXR_Formatter.php',
93+
'WP_Export_XML_Over_HTTP' => $vendorDir . '/wp-cli/export-command/src/WP_Export_XML_Over_HTTP.php',
94+
'WP_Iterator_Exception' => $vendorDir . '/wp-cli/export-command/src/WP_Iterator_Exception.php',
95+
'WP_Map_Iterator' => $vendorDir . '/wp-cli/export-command/src/WP_Map_Iterator.php',
96+
'WP_Post_IDs_Iterator' => $vendorDir . '/wp-cli/export-command/src/WP_Post_IDs_Iterator.php',
97+
'Widget_Command' => $vendorDir . '/wp-cli/widget-command/src/Widget_Command.php',
98+
);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
// autoload_commands_real.php @generated by Composer
4+
5+
class ComposerAutoloaderInitfaaedbb48b1037e6742d43bf8edf962c
6+
{
7+
private static $loader;
8+
9+
public static function loadClassLoader($class)
10+
{
11+
if ('Composer\Autoload\ClassLoader' === $class) {
12+
require __DIR__ . '/ClassLoader.php';
13+
}
14+
}
15+
16+
public static function getLoader()
17+
{
18+
if (null !== self::$loader) {
19+
return self::$loader;
20+
}
21+
22+
spl_autoload_register(array('ComposerAutoloaderInitfaaedbb48b1037e6742d43bf8edf962c', 'loadClassLoader'), true, true);
23+
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24+
spl_autoload_unregister(array('ComposerAutoloaderInitfaaedbb48b1037e6742d43bf8edf962c', 'loadClassLoader'));
25+
26+
$classMap = require __DIR__ . '/autoload_commands_classmap.php';
27+
if ($classMap) {
28+
$loader->addClassMap($classMap);
29+
}
30+
$loader->register(true);
31+
32+
return $loader;
33+
}
34+
}

0 commit comments

Comments
 (0)