diff --git a/tests/webfiori/framework/test/FileTest.php b/tests/webfiori/framework/test/FileTest.php index 3a6d5c9..39b6dbe 100644 --- a/tests/webfiori/framework/test/FileTest.php +++ b/tests/webfiori/framework/test/FileTest.php @@ -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 */