Skip to content

Commit

Permalink
test: Added Test for Append
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Dec 22, 2024
1 parent ffc2260 commit 090d2c5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/webfiori/framework/test/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ public function test08() {
$this->assertEquals("This is to test if read from same directory is working.\n", $file->getRawData());
$this->assertEquals('{"id":-1,"mime":"text\/plain","name":"in-dir.txt","directory":"C:\\inetpub\\wwwroot\\dev\\IbrahimSpace\\file\\tests\\webfiori\\framework\\test","sizeInBytes":57,"sizeInKBytes":0.0556640625,"sizeInMBytes":5.4359436035156E-5}', $file.'');
}
/**
* @test
*/
public function testAppend00() {
$file = new File('text-file-x.txt',ROOT_PATH.DS.'tests'.DS.'files');
$this->assertEquals('', $file->getRawData());
$file->append('Hello');
$this->assertEquals('Hello', $file->getRawData());
$file->append(' World!');
$file->append([
' More ',
'Data'
]);
$this->assertEquals('Hello World! More Data', $file->getRawData());
}
/**
* @test
*/
Expand Down

0 comments on commit 090d2c5

Please sign in to comment.