Skip to content

Commit

Permalink
Merge pull request #542 from carusogabriel/refactoring-tests
Browse files Browse the repository at this point in the history
Refactoring tests
  • Loading branch information
nicolasmure authored Jan 4, 2018
2 parents ee582de + ac60010 commit 2f22865
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function shouldKeepFileObjectInRegister()
$FileObjectA = $this->filesystem->createFile($path);
$FileObjectB = $this->filesystem->createFile($path);

$this->assertTrue($FileObjectA === $FileObjectB);
$this->assertSame($FileObjectB, $FileObjectA);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Gaufrette/Functional/Adapter/LocalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function shouldBeAbleToClearCache()
$this->filesystem->clearFileRegister();
$fsRegister = $fsReflection->getProperty('fileRegister');
$fsRegister->setAccessible(true);
$this->assertEquals(0, count($fsRegister->getValue($this->filesystem)));
$this->assertCount(0, $fsRegister->getValue($this->filesystem));

$this->filesystem->delete('test.txt');
$this->filesystem->delete('test2.txt');
Expand Down
6 changes: 3 additions & 3 deletions tests/Gaufrette/Functional/FileStream/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public function shouldCheckIsFile()
public function shouldCheckFileExists()
{
$this->filesystem->write('test.txt', 'some content');
$this->assertTrue(file_exists('gaufrette://filestream/test.txt'));
$this->assertFileExists('gaufrette://filestream/test.txt');

$this->filesystem->delete('test.txt');
$this->assertFalse(file_exists('gaufrette://filestream/test.txt'));
$this->assertFileNotExists('gaufrette://filestream/test.txt');
}

/**
Expand Down Expand Up @@ -201,7 +201,7 @@ public function shouldCopyFile()
public function shouldCreateNewFile($mode)
{
$fileHandler = fopen('gaufrette://filestream/test.txt', $mode);
$this->assertTrue(file_exists('gaufrette://filestream/test.txt'));
$this->assertFileExists('gaufrette://filestream/test.txt');
}

public static function modesProvider()
Expand Down
2 changes: 1 addition & 1 deletion tests/Gaufrette/Functional/FileStream/LocalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public function tearDown()
public function shouldSupportsDirectory()
{
$this->assertFileExists('gaufrette://filestream/subdir');
$this->assertTrue(is_dir('gaufrette://filestream/subdir'));
$this->assertDirectoryExists('gaufrette://filestream/subdir');
}
}

0 comments on commit 2f22865

Please sign in to comment.