Skip to content

Commit

Permalink
Mark UnzipStep tests as skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpayton committed Dec 23, 2024
1 parent dd7abb9 commit d3b8674
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions tests/unit/steps/UnzipStepRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,39 @@ public function after() {
$this->filesystem->remove( $this->document_root );
}

// public function testUnzipFileWhenUsingAbsolutePath() {
// $zip = __DIR__ . '/resources/test_zip.zip';
// $this->resource_manager->method( 'getStream' )
// ->willReturn( fopen( $zip, 'rb' ) );
public function testUnzipFileWhenUsingAbsolutePath() {
// TODO: Remove once UnzipStep is implemented
$this->markTestSkipped('UnzipStep not yet implemented.');

// $step = new UnzipStep();
// $step->setZipFile( $zip );
// $extracted_file_path = $this->runtime->resolvePath( 'dir/test_zip.txt' );
// $step->setExtractToPath( Path::getDirectory( $extracted_file_path ) );
$zip = __DIR__ . '/resources/test_zip.zip';
$this->resource_manager->method( 'getStream' )
->willReturn( fopen( $zip, 'rb' ) );

// $this->step_runner->run( $step, new Tracker() );
$step = new UnzipStep();
$step->setZipFile( $zip );
$extracted_file_path = $this->runtime->resolvePath( 'dir/test_zip.txt' );
$step->setExtractToPath( Path::getDirectory( $extracted_file_path ) );

// self::assertFileEquals( __DIR__ . '/resources/test_zip.txt', $extracted_file_path );
// }
$this->step_runner->run( $step, new Tracker() );

// public function testUnzipFileWhenUsingRelativePath() {
// $zip = __DIR__ . '/resources/test_zip.zip';
// $this->resource_manager->method( 'getStream' )
// ->willReturn( fopen( $zip, 'rb' ) );
self::assertFileEquals( __DIR__ . '/resources/test_zip.txt', $extracted_file_path );
}

public function testUnzipFileWhenUsingRelativePath() {
// TODO: Remove once UnzipStep is implemented
$this->markTestSkipped('UnzipStep not yet implemented.');

// $step = new UnzipStep();
// $step->setZipFile( $zip );
// $step->setExtractToPath( 'dir' );
$zip = __DIR__ . '/resources/test_zip.zip';
$this->resource_manager->method( 'getStream' )
->willReturn( fopen( $zip, 'rb' ) );

// $this->step_runner->run( $step, new Tracker() );
$step = new UnzipStep();
$step->setZipFile( $zip );
$step->setExtractToPath( 'dir' );

// $extracted_file_path = $this->runtime->resolvePath( 'dir/test_zip.txt' );
// self::assertFileEquals( __DIR__ . '/resources/test_zip.txt', $extracted_file_path );
// }
$this->step_runner->run( $step, new Tracker() );

$extracted_file_path = $this->runtime->resolvePath( 'dir/test_zip.txt' );
self::assertFileEquals( __DIR__ . '/resources/test_zip.txt', $extracted_file_path );
}
}

0 comments on commit d3b8674

Please sign in to comment.