~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to tests/integration/ResolutionTest.php

  • Committer: Dan Garner
  • Date: 2016-04-28 13:57:49 UTC
  • mfrom: (494.1.28)
  • Revision ID: git-v1:1d7f53c2f62d46799f33b7356d8f45ff10668e26
Merge pull request #167 from dasgarner/feature/test-suite

Feature/test suite

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
namespace Xibo\Tests\Integration;
9
9
 
10
10
use Xibo\Helper\Random;
 
11
use Xibo\OAuth2\Client\Entity\XiboResolution;
11
12
use Xibo\Tests\LocalWebTestCase;
12
13
 
 
14
/**
 
15
 * Class ResolutionTest
 
16
 * @package Xibo\Tests\Integration
 
17
 */
13
18
class ResolutionTest extends LocalWebTestCase
14
19
{
15
 
    public function __construct()
16
 
    {
17
 
        parent::__construct('Resolution Test');
18
 
    }
19
 
 
20
20
    public function testListAll()
21
21
    {
22
22
        $this->client->get('/resolution');
62
62
     */
63
63
    public function testEdit($resolutionId)
64
64
    {
65
 
        $resolution = $this->container->resolutionFactory->getById($resolutionId);
 
65
        $resolution = (new XiboResolution($this->getEntityProvider()))->getById($resolutionId);
66
66
 
67
67
        $name = Random::generateString(8, 'phpunit');
68
68
 
80
80
        $this->assertObjectHasAttribute('data', $object);
81
81
 
82
82
        // Deeper check by querying for resolution again
83
 
        $object = $this->container->resolutionFactory->getById($resolutionId);
 
83
        $object = (new XiboResolution($this->getEntityProvider()))->getById($resolutionId);
84
84
 
85
85
        $this->assertSame($name, $object->resolution);
86
86
        $this->assertSame(1, $object->enabled, 'Enabled has been switched');
95
95
     */
96
96
    public function testEditEnabled($resolutionId)
97
97
    {
98
 
        $resolution = $this->container->resolutionFactory->getById($resolutionId);
 
98
        $resolution = (new XiboResolution($this->getEntityProvider()))->getById($resolutionId);
99
99
 
100
100
        $this->client->put('/resolution/' . $resolutionId, [
101
101
            'resolution' => $resolution->resolution,
112
112
        $this->assertObjectHasAttribute('data', $object);
113
113
 
114
114
        // Deeper check by querying for resolution again
115
 
        $object = $this->container->resolutionFactory->getById($resolutionId);
 
115
        $object = (new XiboResolution($this->getEntityProvider()))->getById($resolutionId);
116
116
 
117
117
        $this->assertSame($resolution->resolution, $object->resolution);
118
118
        $this->assertSame(1080, $object->width);