Last active
August 30, 2016 01:09
-
-
Save jlamim/3a3c2cedd53d4d1ddf083a68aaa7321e to your computer and use it in GitHub Desktop.
Testes unitários nativos no CodeIgniter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Testes extends CI_Controller { | |
public function __construct() | |
{ | |
parent::__construct(); | |
$this->load->library('unit_test'); | |
} | |
public function UmMaisUm() | |
{ | |
$test = 1 + 1; | |
$expected_result = 2; | |
$test_name = 'Um mais um'; | |
$str_template = 'ITEM | DESCRIÇÃO'.PHP_EOL.'{rows}{item} | {result}'.PHP_EOL.'{/rows}'; | |
$this->unit->set_template($str_template); | |
echo $this->unit->run($test, $expected_result, $test_name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment