Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
'elseif' => true,
'phpdoc_add_missing_param_annotation' => true,
'no_extra_blank_lines' => true,
'no_trailing_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'blank_line_before_statement' => array(
'statements' => array(
'try',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct( $field_name, $field_value, $data ) {
$this->data['unit_measurement'] = $this->detect_unit_measurement();
$this->data['has-multiple-values'] = count( $this->get_values() ) > 1;
$this->data['units'] = $this->get_units_list( $data );
$this->data['value_label'] = empty( $this->detect_unit_measurement() ) ? $field_value : (float) $field_value;
$this->data['value_label'] = empty( $this->detect_unit_measurement() ) ? $field_value : (float) $field_value;

$this->init_defaults();
$this->init_icon();
Expand Down
2 changes: 1 addition & 1 deletion classes/views/styles/components/templates/slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
</div>
</div>

<?php
<?php
foreach ( $component['independent_fields'] as $field ) :
?>
<div class="frm-slider-component frm-independent-slider-field frm_hidden" data-type="<?php echo esc_attr( $field['type'] ); ?>" data-max-value="<?php echo (int) $component['max_value']; ?>">
Expand Down
4 changes: 2 additions & 2 deletions stripe/controllers/FrmTransLiteActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static function replace_success_message() {

return $message;
}

/**
* @param WP_Post $action
* @param stdClass $entry
Expand Down Expand Up @@ -615,7 +615,7 @@ public static function before_save_settings( $settings, $action ) {
if ( ! $gateway_field_id ) {
self::add_a_gateway_field( $form_id );
}

return $settings;
}

Expand Down
54 changes: 27 additions & 27 deletions tests/phpunit/helpers/test_FrmCssScopeHelper.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php

/**
* @group helpers
Expand Down Expand Up @@ -30,7 +30,7 @@ public function test_nest_basic_selector() {
$css = '.button { color: red; }';
$result = $this->helper->nest( $css, $this->scope_name );
$expected = "\n." . $this->scope_name . " .button { color: red; }\n";

$this->assertEquals( $expected, $result );
}

Expand All @@ -40,7 +40,7 @@ public function test_nest_basic_selector() {
public function test_nest_multiple_selectors() {
$css = '.button, .link { color: blue; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .button', $result );
$this->assertStringContainsString( '.' . $this->scope_name . ' .link', $result );
}
Expand All @@ -51,7 +51,7 @@ public function test_nest_multiple_selectors() {
public function test_nest_multiple_properties() {
$css = '.button { color: red; background: blue; padding: 10px; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .button', $result );
$this->assertStringContainsString( 'color: red;', $result );
$this->assertStringContainsString( 'background: blue;', $result );
Expand All @@ -64,7 +64,7 @@ public function test_nest_multiple_properties() {
public function test_nest_descendant_selectors() {
$css = '.parent .child { color: green; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .parent .child', $result );
}

Expand All @@ -74,7 +74,7 @@ public function test_nest_descendant_selectors() {
public function test_nest_pseudo_classes() {
$css = '.button:hover { color: red; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .button:hover', $result );
}

Expand All @@ -84,7 +84,7 @@ public function test_nest_pseudo_classes() {
public function test_nest_pseudo_elements() {
$css = '.button::before { content: "→"; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .button::before', $result );
}

Expand All @@ -94,7 +94,7 @@ public function test_nest_pseudo_elements() {
public function test_nest_media_query() {
$css = '@media (max-width: 768px) { .button { color: red; } }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '@media (max-width: 768px)', $result );
$this->assertStringContainsString( '.' . $this->scope_name . ' .button', $result );
}
Expand All @@ -105,7 +105,7 @@ public function test_nest_media_query() {
public function test_nest_keyframes() {
$css = '@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '@keyframes fadeIn', $result );
$this->assertStringContainsString( 'from { opacity: 0; }', $result );
$this->assertStringContainsString( 'to { opacity: 1; }', $result );
Expand All @@ -119,7 +119,7 @@ public function test_nest_keyframes() {
public function test_nest_removes_comments() {
$css = '/* Formidable CSS comment */ .button { color: red; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringNotContainsString( '/* Formidable CSS comment */', $result );
$this->assertStringContainsString( '.' . $this->scope_name . ' .button', $result );
}
Expand All @@ -134,7 +134,7 @@ public function test_nest_multiline_css() {
padding: 10px;
}';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .button', $result );
$this->assertStringContainsString( 'color: red;', $result );
}
Expand All @@ -145,7 +145,7 @@ public function test_nest_multiline_css() {
public function test_nest_attribute_selectors() {
$css = 'input[type="text"] { border: 1px solid #ccc; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' input[type="text"]', $result );
}

Expand All @@ -155,7 +155,7 @@ public function test_nest_attribute_selectors() {
public function test_nest_empty_css() {
$css = '';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertEquals( '', $result );
}

Expand All @@ -165,7 +165,7 @@ public function test_nest_empty_css() {
public function test_unnest_basic_selector() {
$css = '.' . $this->scope_name . ' .button { color: red; }';
$result = $this->helper->unnest( $css, $this->scope_name );

$this->assertStringContainsString( '.button { color: red; }', $result );
$this->assertStringNotContainsString( '.' . $this->scope_name . ' .button', $result );
}
Expand All @@ -176,7 +176,7 @@ public function test_unnest_basic_selector() {
public function test_unnest_multiple_selectors() {
$css = '.' . $this->scope_name . ' .button, ' . $this->scope_name . ' .link { color: blue; }';
$result = $this->helper->unnest( $css, $this->scope_name );

$this->assertStringContainsString( '.button', $result );
$this->assertStringContainsString( '.link', $result );
$this->assertStringNotContainsString( '.' . $this->scope_name, $result );
Expand All @@ -188,7 +188,7 @@ public function test_unnest_multiple_selectors() {
public function test_unnest_media_query() {
$css = '@media (max-width: 768px) { ' . $this->scope_name . ' .button { color: red; } }';
$result = $this->helper->unnest( $css, $this->scope_name );

$this->assertStringContainsString( '@media (max-width: 768px)', $result );
$this->assertStringContainsString( '.button', $result );
$this->assertStringNotContainsString( '.' . $this->scope_name . ' .button', $result );
Expand All @@ -200,7 +200,7 @@ public function test_unnest_media_query() {
public function test_unnest_non_prefixed_selector() {
$css = '.other-scope .button { color: red; }';
$result = $this->helper->unnest( $css, $this->scope_name );

$this->assertStringContainsString( '.other-scope .button', $result );
}

Expand All @@ -210,7 +210,7 @@ public function test_unnest_non_prefixed_selector() {
public function test_unnest_mixed_selectors() {
$css = '.' . $this->scope_name . ' .button, .other .link { color: blue; }';
$result = $this->helper->unnest( $css, $this->scope_name );

$this->assertStringContainsString( '.button', $result );
$this->assertStringContainsString( '.other .link', $result );
}
Expand All @@ -224,7 +224,7 @@ public function test_nest_complex_nested_structure() {
.link { color: blue; }
}';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '@media (max-width: 768px)', $result );
$this->assertStringContainsString( '.' . $this->scope_name . ' .button', $result );
$this->assertStringContainsString( '.' . $this->scope_name . ' .link', $result );
Expand All @@ -236,7 +236,7 @@ public function test_nest_complex_nested_structure() {
public function test_nest_id_selector() {
$css = '#element-id { color: red; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' #element-id', $result );
}

Expand All @@ -246,7 +246,7 @@ public function test_nest_id_selector() {
public function test_nest_child_combinator() {
$css = '.parent > .child { color: red; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .parent > .child', $result );
}

Expand All @@ -256,7 +256,7 @@ public function test_nest_child_combinator() {
public function test_nest_adjacent_sibling_combinator() {
$css = '.first + .second { margin-left: 10px; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .first + .second', $result );
}

Expand All @@ -266,7 +266,7 @@ public function test_nest_adjacent_sibling_combinator() {
public function test_nest_general_sibling_combinator() {
$css = '.first ~ .second { color: blue; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .first ~ .second', $result );
}

Expand All @@ -276,7 +276,7 @@ public function test_nest_general_sibling_combinator() {
public function test_nest_with_braces_in_strings() {
$css = '.button::after { content: "{test}"; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' .button::after', $result );
$this->assertStringContainsString( 'content: "{test}"', $result );
}
Expand All @@ -287,7 +287,7 @@ public function test_nest_with_braces_in_strings() {
public function test_nest_supports_rule() {
$css = '@supports (display: grid) { .container { display: grid; } }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '@supports (display: grid)', $result );
$this->assertStringContainsString( '.' . $this->scope_name . ' .container', $result );
}
Expand All @@ -298,7 +298,7 @@ public function test_nest_supports_rule() {
public function test_nest_element_selectors() {
$css = 'div { margin: 0; } p { padding: 10px; }';
$result = $this->helper->nest( $css, $this->scope_name );

$this->assertStringContainsString( '.' . $this->scope_name . ' div', $result );
$this->assertStringContainsString( '.' . $this->scope_name . ' p', $result );
}
Expand All @@ -309,7 +309,7 @@ public function test_nest_element_selectors() {
public function test_unnest_empty_css() {
$css = '';
$result = $this->helper->unnest( $css, $this->scope_name );

$this->assertEquals( '', $result );
}
}