Skip to content

Commit

Permalink
Rename some tests and fix indents
Browse files Browse the repository at this point in the history
  • Loading branch information
reimic committed Mar 30, 2024
1 parent bf0c2b1 commit 8d3eb03
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions tests/unit/steps/MkdirStepRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,41 +51,41 @@ public function after() {
$this->filesystem->remove( $this->document_root );
}

public function testCreateDirectoryWhenUsingRelativePath() {
$path = 'dir';
$step = new MkdirStep();
public function testCreateDirectoryWhenUsingRelativePath() {
$path = 'dir';
$step = new MkdirStep();
$step->setPath( $path );

$this->step_runner->run( $step );
$resolved_path = $this->runtime->resolvePath( $path );
$this->step_runner->run( $step );

$resolved_path = $this->runtime->resolvePath( $path );
self::assertDirectoryExists( $resolved_path );
}
}

public function testCreateDirectoryWhenUsingAbsoluteAbsolutePath() {
$relative_path = 'dir';
$resolved_path = $this->runtime->resolvePath( $relative_path );
public function testCreateDirectoryWhenUsingAbsolutePath() {
$relative_path = 'dir';
$absolute_path = $this->runtime->resolvePath( $relative_path );

$step = new MkdirStep();
$step->setPath( $resolved_path );
$step = new MkdirStep();
$step->setPath( $absolute_path );

$this->step_runner->run( $step );

self::assertDirectoryExists( $resolved_path );
}
$this->step_runner->run( $step );

public function testCreateDirectoryRecursively() {
$path = 'dir/subdir';
$step = new MkdirStep();
$step->setPath( $path );
self::assertDirectoryExists( $absolute_path );
}

$this->step_runner->run( $step );
public function testCreateDirectoryRecursively() {
$path = 'dir/subdir';
$step = new MkdirStep();
$step->setPath( $path );

$resolved_path = $this->runtime->resolvePath( $path );
self::assertDirectoryExists( $resolved_path );
}
$this->step_runner->run( $step );

$resolved_path = $this->runtime->resolvePath( $path );
self::assertDirectoryExists( $resolved_path );
}

public function testCreateDirectoryWithProperMode() {
public function testCreateReadableAndWritableDirectory() {
$path = 'dir';
$step = new MkdirStep();
$step->setPath( $path );
Expand All @@ -97,17 +97,17 @@ public function testCreateDirectoryWithProperMode() {
self::assertDirectoryIsWritable( $resolved_path );
self::assertDirectoryIsReadable( $resolved_path );
}
public function testThrowExceptionWhenCreatingDirectoryWhenDirectoryAlreadyExists() {
$path = 'dir';
$resolved_path = $this->runtime->resolvePath( $path );

public function testThrowExceptionWhenCreatingDirectoryAndItAlreadyExists() {
$path = 'dir';
$resolved_path = $this->runtime->resolvePath( $path );
$this->filesystem->mkdir( $resolved_path );

$step = new MkdirStep();
$step->setPath( $path );

self::expectException( BlueprintException::class );
self::expectExceptionMessage( "Failed to create \"$resolved_path\": the directory exists." );
$this->step_runner->run( $step );
}
$this->step_runner->run( $step );
}
}

0 comments on commit 8d3eb03

Please sign in to comment.