Skip to content

Commit

Permalink
Merge pull request #4170 from Codeinwp/chore/php-lint-version
Browse files Browse the repository at this point in the history
chore: use 7.4 for PHP tests
  • Loading branch information
Soare-Robert-Daniel authored Dec 8, 2023
2 parents d0c9f9b + 46c7582 commit a10eed8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
php-version: '7.4'
extensions: simplexml
tools: composer:v2.1
- name: Checkout source code
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
php-version: '7.4'
extensions: simplexml, mysql
tools: phpunit-polyfills
- name: Checkout source code
Expand Down
55 changes: 28 additions & 27 deletions tests/test-neve-dynamic-selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function test_css_generation_with_color() {
$css = '';
$css .= $subscriber;
$this->assertNotEmpty( $css );
$this->assertContains( "#ccc", $css );
$this->assertStringContainsString( "#ccc", $css );
}

public function test_css_generation_with_generic_rule() {
Expand All @@ -45,7 +45,7 @@ public function test_css_generation_with_generic_rule() {
] );
$css = '';
$css .= $subscriber;
$this->assertContains('--css-var-example', $css);
$this->assertStringContainsString('--css-var-example', $css);
$this->assertNotEmpty( $css );
}

Expand All @@ -64,8 +64,8 @@ public function test_css_generation_with_value_override() {
$css .= $subscriber;

$this->assertNotEmpty( $css );
$this->assertNotContains( "#bada55", $css );
$this->assertContains( "var(--nv-text-color)", $css );
$this->assertStringNotContainsString( "#bada55", $css );
$this->assertStringContainsString( "var(--nv-text-color)", $css );
}

public function test_css_generation_with_key() {
Expand All @@ -81,7 +81,7 @@ public function test_css_generation_with_key() {
$css .= $subscriber;

$this->assertNotEmpty( $css );
$this->assertContains( "#eee", $css );
$this->assertStringContainsString( "#eee", $css );
}

public function test_css_generation_with_suffix() {
Expand All @@ -98,7 +98,7 @@ public function test_css_generation_with_suffix() {
$css .= $subscriber;

$this->assertNotEmpty( $css );
$this->assertContains( "333em", $css );
$this->assertStringContainsString( "333em", $css );
}

public function test_css_generation_with_default() {
Expand All @@ -113,7 +113,7 @@ public function test_css_generation_with_default() {
$css = '';
$css .= $subscriber;
$this->assertNotEmpty( $css );
$this->assertContains( "929", $css );
$this->assertStringContainsString( "929", $css );
}

public function test_css_generation_with_filter() {
Expand All @@ -132,7 +132,7 @@ public function test_css_generation_with_filter() {
$css = '';
$css .= $subscriber;
$this->assertNotEmpty( $css );
$this->assertContains( "box-shadow: 333px;", $css );
$this->assertStringContainsString( "box-shadow: 333px;", $css );
}

public function test_css_generation_on_breakpoints() {
Expand All @@ -149,7 +149,7 @@ public function test_css_generation_on_breakpoints() {
$tablet_css = '' . $subscriber->for_tablet();

$this->assertNotEmpty( $mobile_css );
$this->assertContains( "929", $mobile_css );
$this->assertStringContainsString( "929", $mobile_css );
$this->assertEmpty( $desktop_css );
$this->assertEmpty( $tablet_css );
}
Expand All @@ -172,9 +172,9 @@ public function test_css_generation_with_responsive() {
$mobile_css = '' . $subscriber;
$desktop_css = '' . $subscriber->for_desktop();
$tablet_css = '' . $subscriber->for_tablet();
$this->assertContains( "10px;", $mobile_css );
$this->assertContains( "50px;", $desktop_css );
$this->assertContains( "300px;", $tablet_css );
$this->assertStringContainsString( "10px;", $mobile_css );
$this->assertStringContainsString( "50px;", $desktop_css );
$this->assertStringContainsString( "300px;", $tablet_css );
}

public function test_css_generation_with_responsiveness_encoded() {
Expand All @@ -194,9 +194,9 @@ public function test_css_generation_with_responsiveness_encoded() {
$mobile_css = '' . $subscriber;
$desktop_css = '' . $subscriber->for_desktop();
$tablet_css = '' . $subscriber->for_tablet();
$this->assertContains( "10px;", $mobile_css );
$this->assertContains( "50px;", $desktop_css );
$this->assertContains( "300px;", $tablet_css );
$this->assertStringContainsString( "10px;", $mobile_css );
$this->assertStringContainsString( "50px;", $desktop_css );
$this->assertStringContainsString( "300px;", $tablet_css );
}

public function test_css_generation_with_responsiveness_no_devices() {
Expand All @@ -212,9 +212,9 @@ public function test_css_generation_with_responsiveness_no_devices() {
$mobile_css = '' . $subscriber;
$desktop_css = '' . $subscriber->for_desktop();
$tablet_css = '' . $subscriber->for_tablet();
$this->assertContains( "200px;", $mobile_css );
$this->assertContains( "200px;", $desktop_css );
$this->assertContains( "200px;", $tablet_css );
$this->assertStringContainsString( "200px;", $mobile_css );
$this->assertStringContainsString( "200px;", $desktop_css );
$this->assertStringContainsString( "200px;", $tablet_css );
}

public function test_css_generation_responsiveness_with_subkey() {
Expand All @@ -236,9 +236,9 @@ public function test_css_generation_responsiveness_with_subkey() {
$mobile_css = '' . $subscriber;
$desktop_css = '' . $subscriber->for_desktop();
$tablet_css = '' . $subscriber->for_tablet();
$this->assertContains( "555px;", $mobile_css );
$this->assertContains( "666px;", $desktop_css );
$this->assertContains( "777px;", $tablet_css );
$this->assertStringContainsString( "555px;", $mobile_css );
$this->assertStringContainsString( "666px;", $desktop_css );
$this->assertStringContainsString( "777px;", $tablet_css );
}

public function test_css_generation_responsiveness_with_subkey_with_suffix() {
Expand All @@ -265,9 +265,9 @@ public function test_css_generation_responsiveness_with_subkey_with_suffix() {
$mobile_css = '' . $subscriber;
$desktop_css = '' . $subscriber->for_desktop();
$tablet_css = '' . $subscriber->for_tablet();
$this->assertContains( "555em;", $mobile_css );
$this->assertContains( "666%;", $desktop_css );
$this->assertContains( "777px;", $tablet_css );
$this->assertStringContainsString( "555em;", $mobile_css );
$this->assertStringContainsString( "666%;", $desktop_css );
$this->assertStringContainsString( "777px;", $tablet_css );
}

public function test_css_generation_with_extra_selectors() {
Expand All @@ -285,8 +285,9 @@ public function test_css_generation_with_extra_selectors() {
] );
$css = '' . $subscriber;

$this->assertContains( ",.one-test-selector", $css );
$this->assertNotContains( \Neve\Core\Settings\Config::CSS_SELECTOR_BTN_PRIMARY_HOVER, $css );
$this->assertContains( "color: #fff", $css );
$this->assertStringContainsString( ",.one-test-selector", $css );
$this->assertStringNotContainsString( \Neve\Core\Settings\Config::CSS_SELECTOR_BTN_PRIMARY_HOVER, $css );
$this->assertStringContainsString( \Neve\Core\Settings\Config::$css_selectors_map[\Neve\Core\Settings\Config::CSS_SELECTOR_BTN_PRIMARY_HOVER], $css );
$this->assertStringContainsString( "color: #fff", $css );
}
}

0 comments on commit a10eed8

Please sign in to comment.