HM\BackUpWordPress\Site_Size_Tests::test_file_size_excluded_directly PHP Method

test_file_size_excluded_directly() public method

Main test: Site_Size->filesize( $file ) Expected: file size should be 0.
    public function test_file_size_excluded_directly()
    {
        $file_path = $this->test_data . '/test-data.txt';
        $file = new \SplFileInfo($file_path);
        // Check the file is created and its size is NOT 0.
        $this->assertContains($this->root->getPath(), $file->getPath());
        $this->assertNotSame($file->getSize(), 0);
        // Exclude file directly - file size should be 0.
        $excluded_file_site_size = new Site_Size('file', new Excludes($file_path));
        $this->assertSame($excluded_file_site_size->filesize($file), 0);
    }