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

testGenerateDispatchesEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 14
nc 1
nop 0
dl 0
loc 19
rs 9.4285
c 0
b 0
f 0
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