Completed
Pull Request — master (#1175)
by Grégoire
03:04
created

ConsumerThumbnailTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGenerateDispatchesEvents() 0 19 1
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\MediaBundle\Tests\Thumbnail;
13
14
use Sonata\MediaBundle\Thumbnail\ConsumerThumbnail;
15
16
class ConsumerThumbnailTest extends \PHPUnit_Framework_TestCase
17
{
18
    public function testGenerateDispatchesEvents()
19
    {
20
        $thumbnail = $this->getMock('Sonata\MediaBundle\Thumbnail\ThumbnailInterface');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
21
        $backend = $this->getMock('Sonata\NotificationBundle\Backend\BackendInterface');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
22
        $provider = $this->getMock('Sonata\MediaBundle\Provider\MediaProviderInterface');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
23
        $media = $this->getMock('Sonata\MediaBundle\Model\MediaInterface');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
24
25
        $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
26
        $dispatcher->expects($this->at(0))
27
            ->method('addListener')
28
            ->with($this->equalTo('kernel.finish_request'), $this->anything());
29
30
        $dispatcher->expects($this->at(1))
31
            ->method('addListener')
32
            ->with($this->equalTo('console.terminate'), $this->anything());
33
34
        $consumer = new ConsumerThumbnail('foo', $thumbnail, $backend, $dispatcher);
35
        $consumer->generate($provider, $media);
36
    }
37
}
38