@@ 39-52 (lines=14) @@ | ||
36 | $this->assertTrue(method_exists($this->controller, 'savePartialSubmission')); |
|
37 | } |
|
38 | ||
39 | public function testSavePartialSubmissionFormCreated() |
|
40 | { |
|
41 | $request = new HTTPRequest('POST', '/partialuserform', [], ['Field1' => 'Value1']); |
|
42 | $session = new Session(['hi' => 'bye']); |
|
43 | $request->setSession($session); |
|
44 | ||
45 | $id = $this->controller->savePartialSubmission($request); |
|
46 | ||
47 | $this->assertInternalType('numeric', $id); |
|
48 | ||
49 | $form = PartialFormSubmission::get()->byID($id); |
|
50 | ||
51 | $this->assertInstanceOf(PartialFormSubmission::class, $form); |
|
52 | } |
|
53 | ||
54 | public function testSavePartialSubmissionFieldCreated() |
|
55 | { |
|
@@ 54-65 (lines=12) @@ | ||
51 | $this->assertInstanceOf(PartialFormSubmission::class, $form); |
|
52 | } |
|
53 | ||
54 | public function testSavePartialSubmissionFieldCreated() |
|
55 | { |
|
56 | $request = new HTTPRequest('POST', '/partialuserform', [], ['Field1' => 'Value1']); |
|
57 | $session = new Session(['hi' => 'bye']); |
|
58 | $request->setSession($session); |
|
59 | ||
60 | $id = $this->controller->savePartialSubmission($request); |
|
61 | ||
62 | $fields = PartialFieldSubmission::get()->filter(['SubmittedFormID' => $id]); |
|
63 | ||
64 | $this->assertEquals(1, $fields->count()); |
|
65 | } |
|
66 | ||
67 | public function testPartialFormSubmissionExists() |
|
68 | { |