~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to tests/integration/FaultTest.php

  • Committer: Dan Garner
  • Date: 2015-08-11 09:29:02 UTC
  • mto: This revision was merged to the branch mainline in revision 453.
  • Revision ID: git-v1:a86fb4369b7395c13367577d23b14c0ab4528c1a
Transitions fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * (AuditLogTest.php)
6
6
 */
7
7
 
8
 
namespace Xibo\Tests\Integration;
9
8
 
10
 
/**
11
 
 * Class FaultTest
12
 
 * @package Xibo\Tests\Integration
13
 
 */
14
9
class FaultTest extends \Xibo\Tests\LocalWebTestCase
15
10
{
16
 
    /**
17
 
     * Collect data
18
 
     * This test modifies headers and we therefore need to run in a separate process
19
 
     * @runInSeparateProcess
20
 
     * @preserveGlobalState disabled
21
 
     */
22
11
    public function testCollect()
23
12
    {
24
 
        $this->client->get('/fault/collect', ['outputLog' => 'on']);
25
 
 
 
13
        $this->client->get('/fault/collect');
26
14
        $this->assertSame(200, $this->client->response->status());
27
15
    }
28
16
 
29
 
    /**
30
 
     * test turning debug on
31
 
     */
32
17
    public function testDebugOn()
33
18
    {
 
19
        // Ensure we are
 
20
        \Xibo\Helper\Config::ChangeSetting('audit', Slim\Log::EMERGENCY);
 
21
 
34
22
        $this->client->put('/fault/debug/on');
35
23
        $this->assertSame(200, $this->client->response->status());
 
24
 
 
25
        $this->assertSame(Slim\Log::DEBUG, intval(\Xibo\Helper\Config::GetSetting('audit')));
36
26
    }
37
27
 
38
 
    /**
39
 
     * test turning debug off
40
 
     */
41
28
    public function testDebugOff()
42
29
    {
 
30
        // Ensure we are
 
31
        \Xibo\Helper\Config::ChangeSetting('audit', Slim\Log::DEBUG);
 
32
 
43
33
        $this->client->put('/fault/debug/off');
44
34
        $this->assertSame(200, $this->client->response->status());
 
35
 
 
36
        $this->assertSame(Slim\Log::EMERGENCY, intval(\Xibo\Helper\Config::GetSetting('audit')));
45
37
    }
46
38
}