Skip to content

Commit

Permalink
Allow usage of channelContext in product url provider
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandoorn committed Jul 11, 2017
1 parent 67e2812 commit 6b4ccaf
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 23 deletions.
21 changes: 21 additions & 0 deletions tests/Controller/AbstractTestController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\ApiTestCase;
use Lakion\ApiTestCase\XmlApiTestCase;

/**
* Class AbstractTestController
* @package Tests\SitemapPlugin\Controller
*/
abstract class AbstractTestController extends XmlApiTestCase
{
/**
* @before
*/
public function setUpClient()
{
$this->client = static::createClient(array(), array());
}
}
2 changes: 1 addition & 1 deletion tests/Controller/RelativeClientTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public static function createSharedKernel()
*/
public function setUpClient()
{
$this->client = static::createClient(array('environment' => 'test_relative'), array('HTTP_ACCEPT' => 'application/xml'));
$this->client = static::createClient(array('environment' => 'test_relative'), []);
}
}
7 changes: 3 additions & 4 deletions tests/Controller/SitemapAllControllerApiRelativeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;
use Sylius\Component\Core\Model\Taxon;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapAllControllerApiRelativeTest extends XmlApiTestCase
class SitemapAllControllerApiRelativeTest extends AbstractTestController
{
use RelativeClientTrait;
use TearDownTrait;
use RelativeClientTrait;
use TearDownTrait;

/**
* @before
Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapAllControllerApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;
use Sylius\Component\Core\Model\Taxon;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapAllControllerApiTest extends XmlApiTestCase
class SitemapAllControllerApiTest extends AbstractTestController
{
use TearDownTrait;

Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapIndexControllerApiRelativeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;
use Sylius\Component\Core\Model\Taxon;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapIndexControllerApiRelativeTest extends XmlApiTestCase
class SitemapIndexControllerApiRelativeTest extends AbstractTestController
{
use RelativeClientTrait;
use TearDownTrait;
Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapIndexControllerApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;
use Sylius\Component\Core\Model\Taxon;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapIndexControllerApiTest extends XmlApiTestCase
class SitemapIndexControllerApiTest extends AbstractTestController
{
use TearDownTrait;

Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapProductControllerApiLocalesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapProductControllerApiLocalesTest extends XmlApiTestCase
class SitemapProductControllerApiLocalesTest extends AbstractTestController
{
use TearDownTrait;

Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapProductControllerApiRelativeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapProductControllerApiRelativeTest extends XmlApiTestCase
class SitemapProductControllerApiRelativeTest extends AbstractTestController
{
use RelativeClientTrait;
use TearDownTrait;
Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapProductControllerApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapProductControllerApiTest extends XmlApiTestCase
class SitemapProductControllerApiTest extends AbstractTestController
{
use TearDownTrait;

Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapTaxonControllerApiLocalesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Taxon;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapTaxonControllerApiLocalesTest extends XmlApiTestCase
class SitemapTaxonControllerApiLocalesTest extends AbstractTestController
{
use TearDownTrait;

Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapTaxonControllerApiRelativeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Taxon;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapTaxonControllerApiRelativeTest extends XmlApiTestCase
class SitemapTaxonControllerApiRelativeTest extends AbstractTestController
{
use RelativeClientTrait;
use TearDownTrait;
Expand Down
3 changes: 1 addition & 2 deletions tests/Controller/SitemapTaxonControllerApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace Tests\SitemapPlugin\Controller;

use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Taxon;

/**
* @author Stefan Doorn <[email protected]>
*/
class SitemapTaxonControllerApiTest extends XmlApiTestCase
class SitemapTaxonControllerApiTest extends AbstractTestController
{
use TearDownTrait;

Expand Down

0 comments on commit 6b4ccaf

Please sign in to comment.