Changeset 43055 for trunk/tests/phpunit/tests/user.php
- Timestamp:
- 05/01/2018 01:58:02 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/user.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user.php
r42855 r43055 30 30 'user_url' => 'http://tacos.com', 31 31 'role' => 'contributor', 32 'nickname' => 'Johnny', 33 'description' => 'I am a WordPress user that cares about privacy.', 32 34 ) 33 35 ); … … 1581 1583 $this->assertSame( array( 'administrator' ), get_userdata( $editor )->roles ); 1582 1584 } 1585 1586 /** 1587 * Testing the `wp_user_personal_data_exporter_no_user` function when no user exists. 1588 * 1589 * @ticket 43547 1590 */ 1591 function test_wp_user_personal_data_exporter_no_user() { 1592 $actual = wp_user_personal_data_exporter( 'not-a-user-email@test.com' ); 1593 1594 $expected = array( 1595 'data' => array(), 1596 'done' => true, 1597 ); 1598 1599 $this->assertSame( $expected, $actual ); 1600 } 1601 1602 /** 1603 * Testing the `wp_user_personal_data_exporter_no_user` function when the requested 1604 * user exists. 1605 * 1606 * @ticket 43547 1607 */ 1608 function test_wp_user_personal_data_exporter() { 1609 $test_user = new WP_User( self::$contrib_id ); 1610 1611 $actual = wp_user_personal_data_exporter( $test_user->user_email ); 1612 1613 $this->assertTrue( $actual['done'] ); 1614 1615 // Number of exported users. 1616 $this->assertSame( 1, count( $actual['data'] ) ); 1617 1618 // Number of exported user properties. 1619 $this->assertSame( 12, count( $actual['data'][0]['data'] ) ); 1620 } 1583 1621 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)