Skip to content

Commit

Permalink
Merged php-8.1-readiness branch into master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi committed Mar 14, 2024
1 parent 5e83ab3 commit 27468c2
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/RendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,41 @@ public function testThatNormalizeFolderPathWorksAsExpected() {
$this->assertEquals("/var/www/html", $renderer->normalizeFolderPathPublic('/var/www/html/'));
}

public function testThatGetVarTypeWorksAsExpected() {

$renderer = new FileRendererWrapper('file.txt');

//object
$this->assertEquals("Rotexsoft\\FileRenderer\\Tests\\FileRendererWrapper", $renderer->getVarTypePublic($renderer));
$this->assertEquals("Rotexsoft\\FileRenderer\\Tests\\FileRendererWrapper", $renderer->getVarTypePublic($renderer, true));

//string
$this->assertEquals("string", $renderer->getVarTypePublic('sfff'));
$this->assertEquals("String", $renderer->getVarTypePublic('sfff', true));

//array
$this->assertEquals("array", $renderer->getVarTypePublic([]));
$this->assertEquals("Array", $renderer->getVarTypePublic([], true));

//boolean
$this->assertEquals("boolean", $renderer->getVarTypePublic(false));
$this->assertEquals("Boolean", $renderer->getVarTypePublic(false, true));

//int
$this->assertEquals("integer", $renderer->getVarTypePublic(123));
$this->assertEquals("Integer", $renderer->getVarTypePublic(123, true));

//float a.k.a double
$this->assertEquals("double", $renderer->getVarTypePublic(123.456));
$this->assertEquals("Double", $renderer->getVarTypePublic(123.456, true));

//resource
$temp = tmpfile();
$this->assertEquals("resource", $renderer->getVarTypePublic($temp));
$this->assertEquals("Resource", $renderer->getVarTypePublic($temp, true));
fclose($temp); // this removes the file
}

public function testThatLocateFileWorksAsExpected() {

$file_name = 'fizaile';
Expand Down

0 comments on commit 27468c2

Please sign in to comment.