/
Create.php
62 lines (54 loc) · 1.61 KB
/
Create.php
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php //-->
/*
* A Custom Library
*
* Copyright and license information can be found at LICENSE
* distributed with this package.
*/
class ApiAppBackActionCreateTest extends PHPUnit_Framework_TestCase
{
public function setUp() {
BrowserTest::i()->setTemplate('back');
}
public function testRender()
{
$results = BrowserTest::i()
->setPath('/back/action/create')
->setMethod('GET')
->setIsTriggered(false)
->process();
$this->assertContains('Developer Sign Up', $results['data']);
}
public function testInvalid()
{
$data = array(
'profile_name' => 'Test Action Create',
'profile_email' => 'test321@test.com',
'auth_password' => '123'
);
$results = BrowserTest::i()
->setPath('/back/action/create')
->setPost($data)
->setIsValid(false)
->setIsTriggered(true)
->process();
$this->assertFalse($results['triggered']);
$this->assertContains('Cannot be empty', $results['data']);
}
public function testValid()
{
$data = array(
'profile_name' => 'Test Action Create',
'profile_email' => 'test321@test.com',
'auth_password' => '123',
'confirm' => '123'
);
$results = BrowserTest::i()
->setPath('/back/action/create')
->setPost($data)
->setIsValid(true)
->setIsTriggered(true)
->process();
$this->assertTrue($results['triggered']);
}
}