1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
<?php
/**
* Part of ci-phpunit-test
*
* @author Kenji Suzuki <https://github.com/kenjis>
* @license MIT License
* @copyright 2015 Kenji Suzuki
* @link https://github.com/kenjis/ci-phpunit-test
*/
class Install_test extends TestCase
{
private $realAssertStringContainsString;
public function setUp() : void
{
// Using assertContains() with string haystacks is deprecated and will not be supported in PHPUnit 9
// Refactor your test to use assertStringContainsString() or assertStringContainsStringIgnoringCase() instead.
$this->realAssertStringContainsString = method_exists($this, 'assertStringContainsString')
? 'assertStringContainsString'
: 'assertContains';
}
public function test_index()
{
$output = $this->request('GET', 'install');
call_user_func_array(array($this, $this->realAssertStringContainsString), array('<title>Kalkun › Installation</title>', $output));
}
public function test_method_404()
{
$this->request('GET', 'welcome/method_not_exist');
$this->assertResponseCode(404);
}
public function test_APPPATH()
{
$actual = realpath(APPPATH);
$expected = realpath(__DIR__ . '/../../application');
$this->assertEquals(
$expected,
$actual,
'Your APPPATH seems to be wrong. Check your $application_folder in tests/Bootstrap.php'
);
}
}
|