@@ -46,3 +46,51 @@ Feature: Create a new site on a WP multisite
46
46
| blog_id | url |
47
47
| 1 | http://localhost/dev/ |
48
48
| 2 | http://localhost/dev/newsite/ |
49
+
50
+ Scenario: Create new site with custom `$super_admins` global
51
+ Given an empty directory
52
+ And WP files
53
+ And a database
54
+ And a extra-config file:
55
+ """
56
+ define( 'WP_ALLOW_MULTISITE', true );
57
+ define( 'MULTISITE', true );
58
+ define( 'SUBDOMAIN_INSTALL', false );
59
+ define( 'DOMAIN_CURRENT_SITE', 'localhost' );
60
+ define( 'PATH_CURRENT_SITE', '/' );
61
+ define('SITE_ID_CURRENT_SITE', 1);
62
+ define('BLOG_ID_CURRENT_SITE', 1);
63
+
64
+ $super_admins = array( 1 => 'admin' );
65
+ """
66
+ When I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < extra-config`
67
+ Then STDOUT should be:
68
+ """
69
+ Success: Generated 'wp-config.php' file.
70
+ """
71
+
72
+ # Old versions of WP can generate wpdb database errors if the WP tables don't exist, so STDERR may or may not be empty
73
+ When I try `wp core multisite-install --url=localhost --title=Test --admin_user=admin [email protected] `
74
+ Then STDOUT should contain:
75
+ """
76
+ Success: Network installed. Don't forget to set up rewrite rules
77
+ """
78
+ And the return code should be 0
79
+
80
+ When I run `wp site list --fields=blog_id,url`
81
+ Then STDOUT should be a table containing rows:
82
+ | blog_id | url |
83
+ | 1 | http://localhost/ |
84
+
85
+ When I run `wp site create --slug=newsite`
86
+ Then STDOUT should be:
87
+ """
88
+ Success: Site 2 created: http://localhost/newsite/
89
+ """
90
+
91
+ When I run `wp site list --fields=blog_id,url`
92
+ Then STDOUT should be a table containing rows:
93
+ | blog_id | url |
94
+ | 1 | http://localhost/ |
95
+ | 2 | http://localhost/newsite/ |
96
+
0 commit comments