PMCORE-530

This commit is contained in:
Andrea Adamczyk
2020-09-16 14:54:29 -04:00
parent ea071649d8
commit 6d507bdbe9
3 changed files with 66 additions and 2 deletions

View File

@@ -281,6 +281,34 @@ class AdditionalTablesTest extends TestCase
Queue::assertPushed(GenerateReportTable::class);
}
/**
* It tests the validateParameter method
*
* @covers \AdditionalTables::validateParameter()
* @test
*/
public function it_should_test_the_validate_parameter_method()
{
//Create the AdditionalTables object
$additionalTables = new AdditionalTables();
//Call validateParameter method
$result = $additionalTables->validateParameter(8, 1, 8, 4);
//Assert the number is in the rage
$this->assertEquals(8, $result);
//Call validateParameter method
$result = $additionalTables->validateParameter(9, 1, 5, 4);
//Assert the number has exceeded the max value
$this->assertEquals(5, $result);
//Call validateParameter method
$result = $additionalTables->validateParameter(-3, 1, 5, 4);
//Assert the number has exceeded the min value
$this->assertEquals(1, $result);
//Call validateParameter method
$result = $additionalTables->validateParameter("$%&(%&(DGS=UJHGE32598", 1, 5, 4);
//Assert the number has extrange characters
$this->assertEquals(4, $result);
}
/**
* This gets the content from template file.
* @param string $pathData