PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / vendor / cweagans / composer-patches / tests / PatchEventTest.php

PatchEventTest.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF trunk, at vendor/cweagans/composer-patches/tests/PatchEventTest.php

40 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @file
5 * Tests event dispatching.
6 */
7
8 namespace cweagans\Composer\Tests;
9
10 use cweagans\Composer\PatchEvent;
11 use cweagans\Composer\PatchEvents;
12 use Composer\Package\PackageInterface;
13
14 class PatchEventTest extends \PHPUnit_Framework_TestCase {
15
16 /**
17 * Tests all the getters.
18 *
19 * @dataProvider patchEventDataProvider
20 */
21 public function testGetters($event_name, PackageInterface $package, $url, $description) {
22 $patch_event = new PatchEvent($event_name, $package, $url, $description);
23 $this->assertEquals($event_name, $patch_event->getName());
24 $this->assertEquals($package, $patch_event->getPackage());
25 $this->assertEquals($url, $patch_event->getUrl());
26 $this->assertEquals($description, $patch_event->getDescription());
27 }
28
29 public function patchEventDataProvider() {
30 $prophecy = $this->prophesize('Composer\Package\PackageInterface');
31 $package = $prophecy->reveal();
32
33 return array(
34 array(PatchEvents::PRE_PATCH_APPLY, $package, 'https://www.drupal.org', 'A test patch'),
35 array(PatchEvents::POST_PATCH_APPLY, $package, 'https://www.drupal.org', 'A test patch'),
36 );
37 }
38
39 }
40