Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Add integration and unit tests #402

Merged
merged 7 commits into from
Aug 28, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address more phpcs issues, add a wrapper script for phpcbf
This should be most of the remaining issues.
And running phpcbf should make this easier.
kienstra committed Aug 26, 2019
commit 8cc9205f41e017ea817e270a20986736ecfa3bfb
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
},
"require-dev": {
"brain/monkey": "^2",
"squizlabs/php_codesniffer": "^3.4"
"squizlabs/php_codesniffer": "^3.4",
"wp-coding-standards/wpcs": "2.1.1"
lukecarbis marked this conversation as resolved.
Show resolved Hide resolved
}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,9 @@
},
"scripts": {
"dev": "cross-env BABEL_ENV=default webpack --watch",
"build": "cross-env BABEL_ENV=default NODE_ENV=production webpack"
"build": "cross-env BABEL_ENV=default NODE_ENV=production webpack",
"lint:php": "vendor/bin/phpcs",
"lint:php:fix": "vendor/bin/phpcbf"
},
"author": "Block Lab",
"license": "GPL-2.0+",
6 changes: 3 additions & 3 deletions tests/php/unit/admin/test-class-import.php
Original file line number Diff line number Diff line change
@@ -212,9 +212,9 @@ function wp_handle_upload_error( $file, $message ) {
$this->assertNotContains( $welcome_text, $output );

// The file is now a real file.
$file = array( 'file' => $this->import_file_valid_json );
$tmp_name = $this->import_file_valid_json;
$files_import = array_merge(
$file = array( 'file' => $this->import_file_valid_json );
$tmp_name = $this->import_file_valid_json;
$files_import = array_merge(
$file,
array(
'name' => 'mock-import-valid-format',
3 changes: 2 additions & 1 deletion tests/php/unit/admin/test-class-license.php
Original file line number Diff line number Diff line change
@@ -231,7 +231,8 @@ public function test_activate_license() {
$this->instance->init();
$license_key = '6234234';
add_filter(
self::HTTP_FILTER_NAME, function( $response ) {
self::HTTP_FILTER_NAME,
function( $response ) {
unset( $response );
return new WP_Error();
}