Make WordPress Core

Ticket #65621: 65621.diff

File 65621.diff, 2.2 KB (added by afercia, 7 weeks ago)
  • tests/phpunit/tests/fonts/font-library/fontLibraryHooks.php

     
    1010 */
    1111class Tests_Fonts_FontLibraryHooks extends WP_UnitTestCase {
    1212
     13        /**
     14         * Tear down the test fixture.
     15         */
     16        public function tear_down() {
     17                // Remove all fonts uploaded during the tests.
     18                $this->remove_added_uploads();
     19                parent::tear_down();
     20        }
     21
    1322        public function test_deleting_font_family_deletes_child_font_faces() {
    1423                $font_family_id       = self::factory()->post->create(
    1524                        array(
  • tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php

     
    461461                // Delete the post.
    462462                wp_delete_post( $data['id'], true );
    463463                $this->assertFileDoesNotExist( $expected_file_path, 'The font file should have been deleted when the post was deleted.' );
     464
     465                // Clean up: Delete the subdir test directory.
     466                rmdir( WP_CONTENT_DIR . '/uploads/fonts/subdir' );
    464467        }
    465468
    466469        /**
  • tests/phpunit/tests/user/getActiveBlogForUser.php

     
    6969
    7070                $result = get_active_blog_for_user( self::$user_id );
    7171
    72                 wp_delete_site( $primary_site_id );
     72                /*
     73                 * Avoid using wp_delete_site() here because it will delete the uploads
     74                 * directory without checking if the site is the main one. Otherwise,
     75                 * when this test runs in a single site environment (e.g. when running
     76                 * grunt precommit), it will delete the entire contents of the uploads
     77                 * directory, which we want to avoid.
     78                 */
     79                wpmu_delete_blog( $primary_site_id, true );
    7380
    7481                $this->assertSame( $primary_site_id, $result->id );
    7582        }