activitypub-php/test/TestConfig/APTestCase.php

28 lines
1002 B
PHP
Raw Normal View History

<?php
2019-02-16 17:51:24 +00:00
namespace ActivityPub\Test\TestConfig;
use PHPUnit\Framework\TestCase;
2019-03-02 19:13:39 +00:00
use Symfony\Component\HttpFoundation\Request;
abstract class APTestCase extends TestCase
{
2019-02-16 17:51:24 +00:00
function getMock( $originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = false, $callOriginalClone = false, $callAutoload = true, $cloneArguments = false, $callOriginalMethods = false, $proxyTarget = null )
{
2019-02-16 17:51:24 +00:00
return parent::getMock( $originalClassName, $methods, $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $cloneArguments, $callOriginalMethods, $proxyTarget ); // TODO: Change the autogenerated stub
}
2019-03-02 19:13:39 +00:00
/**
* @param string $uri
* @param array $attributes
* @return Request
*/
public static function requestWithAttributes( $uri, $attributes )
{
$request = Request::create( $uri );
$request->attributes->add( $attributes );
return $request;
}
}