2021-11-20 10:43:40 +00:00
< ? php
/**
* @ file
* Tests event dispatching .
*/
2021-12-11 09:27:25 +00:00
namespace RectorPrefix20211211\cweagans\Composer\Tests ;
2021-11-20 10:43:40 +00:00
2021-12-11 09:27:25 +00:00
use RectorPrefix20211211\cweagans\Composer\PatchEvent ;
use RectorPrefix20211211\cweagans\Composer\PatchEvents ;
use RectorPrefix20211211\Composer\Package\PackageInterface ;
class PatchEventTest extends \RectorPrefix20211211\PHPUnit_Framework_TestCase
2021-11-20 10:43:40 +00:00
{
/**
* Tests all the getters .
*
* @ dataProvider patchEventDataProvider
*/
2021-12-11 09:27:25 +00:00
public function testGetters ( $event_name , \RectorPrefix20211211\Composer\Package\PackageInterface $package , $url , $description )
2021-11-20 10:43:40 +00:00
{
2021-12-11 09:27:25 +00:00
$patch_event = new \RectorPrefix20211211\cweagans\Composer\PatchEvent ( $event_name , $package , $url , $description );
2021-11-20 10:43:40 +00:00
$this -> assertEquals ( $event_name , $patch_event -> getName ());
$this -> assertEquals ( $package , $patch_event -> getPackage ());
$this -> assertEquals ( $url , $patch_event -> getUrl ());
$this -> assertEquals ( $description , $patch_event -> getDescription ());
}
public function patchEventDataProvider ()
{
2021-12-11 09:27:25 +00:00
$prophecy = $this -> prophesize ( 'RectorPrefix20211211\\Composer\\Package\\PackageInterface' );
2021-11-20 10:43:40 +00:00
$package = $prophecy -> reveal ();
2021-12-11 09:27:25 +00:00
return array ( array ( \RectorPrefix20211211\cweagans\Composer\PatchEvents :: PRE_PATCH_APPLY , $package , 'https://www.drupal.org' , 'A test patch' ), array ( \RectorPrefix20211211\cweagans\Composer\PatchEvents :: POST_PATCH_APPLY , $package , 'https://www.drupal.org' , 'A test patch' ));
2021-11-20 10:43:40 +00:00
}
}