Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
chore: trivial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
technote-space committed Jul 16, 2019
1 parent afad271 commit 5d82837
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Expand Up @@ -25,9 +25,12 @@ package.json export-ignore
package-lock.json export-ignore
composer.json export-ignore
composer.lock export-ignore
yarn.lock export-ignore
update.json export-ignore

test export-ignore
__test__ export-ignore
bin export-ignore
assets/js/node_modules export-ignore
assets/js/coverage export-ignore
assets/js/.nyc_output export-ignore
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -26,14 +26,17 @@ logs
/cache

!tests/bin/**/*.sh
/coverage
coverage/
/vendor
/travis-ci
/gh-pages

/.coveralls.yml
/phpcs.xml
/phpmd.xml
/phpunit.xml
/tests/bootstrap.php
/.plugin
/.work
composer.lock
!/bin
5 changes: 4 additions & 1 deletion _config.yml
@@ -1 +1,4 @@
theme: jekyll-theme-cayman
theme: jekyll-theme-cayman

# Google Analytics
google_analytics: UA-78163306-3
14 changes: 12 additions & 2 deletions tests/models/test-editor.php
Expand Up @@ -33,13 +33,19 @@ class EditorTest extends WP_UnitTestCase {
*/
private static $assets;

/**
* @var bool $is_ci
*/
private static $is_ci;

/**
* @SuppressWarnings(StaticAccess)
*/
public static function setUpBeforeClass() {
static::$app = WP_Framework::get_instance( ADD_RICHTEXT_TOOLBAR_BUTTON );
static::$editor = Editor::get_instance( static::$app );
static::$assets = Assets::get_instance( static::$app );
static::$is_ci = ! empty( getenv( 'CI' ) );
static::reset();
}

Expand All @@ -50,13 +56,17 @@ public static function tearDownAfterClass() {
private static function reset() {
wp_dequeue_script( 'add-richtext-toolbar-button-editor' );
wp_dequeue_style( static::$assets->get_css_handle() );
static::$app->file->delete( static::$app->define->plugin_assets_dir . DS . 'js' . DS . 'index.min.js' );
if ( static::$is_ci ) {
static::$app->file->delete( static::$app->define->plugin_assets_dir . DS . 'js' . DS . 'index.min.js' );
}
}

public function test_enqueue_block_editor_assets() {
wp_dequeue_script( 'add-richtext-toolbar-button-editor' );
wp_dequeue_style( static::$assets->get_css_handle() );
static::$app->file->put_contents( static::$app->define->plugin_assets_dir . DS . 'js' . DS . 'index.min.js', '' );
if ( static::$is_ci ) {
static::$app->file->put_contents( static::$app->define->plugin_assets_dir . DS . 'js' . DS . 'index.min.js', '' );
}

static::$app->setting->edit_setting( 'is_valid', 'default', false );
static::$app->delete_shared_object( '_hook_cache' );
Expand Down

0 comments on commit 5d82837

Please sign in to comment.