Merge branch '111_exports' into social_action_exports

This commit is contained in:
2022-07-28 15:47:59 +02:00
15 changed files with 655 additions and 40 deletions

View File

@@ -166,6 +166,7 @@ abstract class AbstractAggregatorTest extends KernelTestCase
$this->assertContainsOnly(
'string',
$queryKeys,
true,
'test that the query keys returned by `getQueryKeys` are only strings'
);
$this->assertGreaterThanOrEqual(

View File

@@ -16,6 +16,7 @@ use Doctrine\ORM\NativeQuery;
use Doctrine\ORM\QueryBuilder;
use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Role\Role;
use Traversable;
@@ -140,6 +141,7 @@ abstract class AbstractExportTest extends WebTestCase
$this->assertContainsOnly(
'string',
$formattersTypes,
true,
'Test that the method `getAllowedFormattersTypes` returns an array of string'
);
}
@@ -174,6 +176,7 @@ abstract class AbstractExportTest extends WebTestCase
$this->assertContainsOnly(
'string',
$queryKeys,
true,
'test that the query keys returned by `getQueryKeys` are only strings'
);
$this->assertGreaterThanOrEqual(
@@ -330,8 +333,9 @@ abstract class AbstractExportTest extends WebTestCase
*/
public function testListExportPage()
{
/** @var \Symfony\Component\BrowserKit\Client $client */
$client = $this->getClient();
/** @var HttpBrowser $client */
$client = new HttpBrowser();
$export = $this->getExport();
$prophet = new \Prophecy\Prophet();
$container = static::$kernel->getContainer();
@@ -395,6 +399,7 @@ abstract class AbstractExportTest extends WebTestCase
$this->assertContainsOnly(
'string',
$export->supportsModifiers(),
true,
'Test that the `supportsModifiers` method returns only strings'
);
} elseif ($query instanceof NativeQuery) {

View File

@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Test\Export;
use Doctrine\ORM\QueryBuilder;
use Exception;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use function count;
@@ -27,14 +28,16 @@ use function is_string;
*/
abstract class AbstractFilterTest extends KernelTestCase
{
use ProphecyTrait;
/**
* @var \Prophecy\Prophet
*/
protected $prophet;
private $prophet;
protected function setUp(): void
{
$this->prepareProphet();
$$this->prophet = $this->getProphet();
}
public function dataProviderAlterQuery()