Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
69b6154
BP: Duotone: Limit SVG filter output to used filters #49103
MaggieCabrera Jun 15, 2023
26ee6d3
wrong place for the included file
MaggieCabrera Jun 15, 2023
4615585
BP: Duotone: Remove Safari rerender hack (#49232)
MaggieCabrera Jun 15, 2023
984486c
BP: Replace regex with tag processor for duotone class render #49212
MaggieCabrera Jun 15, 2023
72f6355
BP: Duotone: Pass filters to the Post Editor #49239
MaggieCabrera Jun 15, 2023
cb980d0
BP: Port colord to PHP #49700
MaggieCabrera Jun 15, 2023
b6f01c6
BP:Deprecate remaining global duotone functions
MaggieCabrera Jun 15, 2023
035a100
BP - partially: Selectors API: Fix for global styles hook, style vari…
MaggieCabrera Jun 15, 2023
83e3c2a
BP - partially: Selectors API: Make duotone selectors fallback and be…
MaggieCabrera Jun 15, 2023
3777e20
BP: Group duotone outputs and refactor rendering #49705
MaggieCabrera Jun 15, 2023
3471457
BP: Polish duotone rendering code #49706
MaggieCabrera Jun 15, 2023
e82e5da
BP: Better error message when theme.json styles use a duotone preset …
MaggieCabrera Jun 15, 2023
89d1c7a
BP: Clarify error message if duotone color values is incorrect #51397
MaggieCabrera Jun 15, 2023
8efbc43
run linter
MaggieCabrera Jun 15, 2023
8dc7158
Add duotone hooks
Jun 15, 2023
9774f6c
Fix comments to reference core versions of functions
Jun 15, 2023
ee7741c
Fix more comments to reference core versions of functions
Jun 15, 2023
4d1d9aa
Use core versions of classes/functions
Jun 15, 2023
9ebb0d3
Remove gutenberg translation domains
Jun 15, 2023
2a90a43
added docs or fixed them
MaggieCabrera Jun 16, 2023
2fd1bf9
Fixed more docblocks
MaggieCabrera Jun 21, 2023
d2306db
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
fb75344
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
f78d01b
Update tests/phpunit/tests/block-supports/duotone.php
MaggieCabrera Jun 26, 2023
7106f33
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
4530c53
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
071e093
fix docblocks for tests
MaggieCabrera Jun 26, 2023
eb1c12e
fix multiline comments
MaggieCabrera Jun 26, 2023
956e65c
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
6dad8db
fix colord functions docblocks
MaggieCabrera Jun 26, 2023
f1c26ea
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
49f0630
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
7d296b4
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
e18f0ae
moved deprecated functions to the correct file
MaggieCabrera Jun 26, 2023
ae122da
Mark private and new deprecated methods as internal
ajlende Jun 26, 2023
6a91d93
Format line wrapping in comment
ajlende Jun 26, 2023
5141c6a
Update deprecated function docblock link and order
ajlende Jun 26, 2023
ec248c2
Fix trailing space
ajlende Jun 26, 2023
375ce41
Add more description to the WP_Duotone methods
ajlende Jun 26, 2023
895363a
Deprecate wp_global_styles_render_svg_filters and wp_get_global_style…
ajlende Jun 27, 2023
5347e2c
Remove tests for deprecated functions
ajlende Jun 27, 2023
1476cff
Move newly deprecated functions to deprecated.php
ajlende Jun 27, 2023
d74a917
Add changelog to PRESETS_METADATA
ajlende Jun 27, 2023
710858d
Add @since 6.3.0 to all duotone methods
ajlende Jun 27, 2023
a114db1
Mark class WP_Duotone as @access private
ajlende Jun 27, 2023
105bd9e
Fix theme json test string
tellthemachines Jun 28, 2023
2541786
Fix lint error
tellthemachines Jun 28, 2023
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
Next Next commit
fix docblocks for tests
  • Loading branch information
MaggieCabrera authored and tellthemachines committed Jun 29, 2023
commit 071e09333edfdfb011a21a2015dfaa80730c2630
44 changes: 27 additions & 17 deletions tests/phpunit/tests/block-supports/duotone.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ public function test_render_duotone_support_custom() {
$this->assertMatchesRegularExpression( $expected, WP_Duotone::render_duotone_support( $block_content, $block ) );
}

/**
* Tests whether the slug is extracted from the attribute.
*
* @dataProvider data_get_slug_from_attribute
* @covers ::get_slug_from_attribute
*/
public function test_get_slug_from_attribute( $data_attr, $expected ) {

$reflection = new ReflectionMethod( 'WP_Duotone', 'get_slug_from_attribute' );
$reflection->setAccessible( true );

$this->assertSame( $expected, $reflection->invoke( null, $data_attr ) );
}

/**
* Data provider.
*
* @return array[].
*/
public function data_get_slug_from_attribute() {
return array(
'pipe-slug' => array( 'var:preset|duotone|blue-orange', 'blue-orange' ),
Expand All @@ -79,19 +98,20 @@ public function data_get_slug_from_attribute() {
}

/**
* Tests whether the slug is extracted from the attribute.
*
* @dataProvider data_get_slug_from_attribute
* @covers ::get_slug_from_attribute
* @dataProvider data_is_preset
*/
public function test_get_slug_from_attribute( $data_attr, $expected ) {

$reflection = new ReflectionMethod( 'WP_Duotone', 'get_slug_from_attribute' );
public function test_is_preset( $data_attr, $expected ) {
$reflection = new ReflectionMethod( 'WP_Duotone', 'is_preset' );
$reflection->setAccessible( true );

$this->assertSame( $expected, $reflection->invoke( null, $data_attr ) );
}

/**
* Data provider.
*
* @return array[].
*/
public function data_is_preset() {
return array(
'pipe-slug' => array( 'var:preset|duotone|blue-orange', true ),
Expand All @@ -101,14 +121,4 @@ public function data_is_preset() {
'invalid' => array( 'not a valid attribute', false ),
);
}

/**
* @dataProvider data_is_preset
*/
public function test_is_preset( $data_attr, $expected ) {
$reflection = new ReflectionMethod( 'WP_Duotone', 'is_preset' );
$reflection->setAccessible( true );

$this->assertSame( $expected, $reflection->invoke( null, $data_attr ) );
}
}