"1.PNG", "path" => PATH_DATA . "1.PNG" ]; // Create the ValidationUploadedFiles object $validation = new ValidationUploadedFiles(); // Call the runRules method $result = $validation->runRules($file); // Asserts the validation did not fail $this->assertFalse($result->fails()); // Asserts there is no a message $this->assertEmpty($result->getMessage()); // Asserts the status is 0 $this->assertEquals(0, $result->getStatus()); } /** * It tests the runRules method when the file extension is in lower case * * @covers ::runRules * @test */ public function it_should_test_the_run_rules_method_in_lower_case() { // Create the file $file = [ "filename" => "1.png", "path" => PATH_DATA . "1.png" ]; // Create the ValidationUploadedFiles object $validation = new ValidationUploadedFiles(); // Call the runRules method $result = $validation->runRules($file); // Asserts the validation did not fail $this->assertFalse($result->fails()); // Asserts there is no a message $this->assertEmpty($result->getMessage()); // Asserts the status is 0 $this->assertEquals(0, $result->getStatus()); } /** * It tests the runRules method when the file extension is in upper and lower case * * @covers ::runRules * @test */ public function it_should_test_the_run_rules_method_in_upper_and_lower_case() { // Create the file $file = [ "filename" => "1.PnG", "path" => PATH_DATA . "1.PnG" ]; // Create the ValidationUploadedFiles object $validation = new ValidationUploadedFiles(); // Call the runRules method $result = $validation->runRules($file); // Asserts the validation did not fail $this->assertFalse($result->fails()); // Asserts there is no a message $this->assertEmpty($result->getMessage()); // Asserts the status is 0 $this->assertEquals(0, $result->getStatus()); } /** * It deletes the images created */ public function tearDown() { parent::tearDown(); // TODO: Change the autogenerated stub unlink(PATH_DATA . '1.PNG'); unlink(PATH_DATA . '1.png'); unlink(PATH_DATA . '1.PnG'); } }