Completed
Push — master ( cf2f5b...2b18f3 )
by Wanderson
02:54
created

ControllerTest::testActionNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 4
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
3
namespace Win\Mvc;
4
5
use controller\IndexController;
6
use Win\Helper\Url;
7
8
class ControllerTest extends \PHPUnit_Framework_TestCase {
9
10
	public function testGetAction() {
11
		$controller = new IndexController('myAction');
12
		$this->assertEquals('myAction', $controller->getAction());
13
14
		$controller2 = new IndexController('my-action');
15
		$this->assertEquals('myAction', $controller2->getAction());
16
17
		Url::instance()->setUrl('my-page/example-action');
18
		new Application();
19
		$controller3 = new IndexController();
20
		$this->assertEquals('exampleAction', $controller3->getAction());
21
	}
22
23
	public function testActionNotFound() {
24
		$index = new IndexController('index');
25
		$index->thisActionDoentExist();
26
		$this->assertEquals('404', $index->app->getPage());
27
	}
28
29
}
30