~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to tests/Middleware/TestAuthMiddleware.php

  • Committer: Dan Garner
  • Date: 2016-02-15 17:54:45 UTC
  • mto: (454.4.130)
  • mto: This revision was merged to the branch mainline in revision 484.
  • Revision ID: git-v1:dd226a6f84464ff28758a249e1fd52ca4a35d911
Correction to Layout Duration ToolTip
xibosignage/xibo#721

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * Spring Signage Ltd - http://www.springsignage.com
4
 
 * Copyright (C) 2016 Spring Signage Ltd
5
 
 * (TestAuthMiddleware.php)
6
 
 */
7
 
 
8
 
 
9
 
namespace Xibo\Tests\Middleware;
10
 
 
11
 
use Slim\Middleware;
12
 
 
13
 
 
14
 
/**
15
 
 * Class TestAuthMiddleware
16
 
 * @package Xibo\Tests\Middleware
17
 
 *
18
 
 */
19
 
class TestAuthMiddleware extends Middleware
20
 
{
21
 
    public function call()
22
 
    {
23
 
        $app = $this->app;
24
 
 
25
 
        $this->app->hook('slim.before.dispatch', function() use ($app) {
26
 
            // Super User
27
 
            $app->user = $app->userFactory->getByName('phpunit');
28
 
        });
29
 
 
30
 
        $this->next->call();
31
 
    }
32
 
}
 
 
b'\\ No newline at end of file'