Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build and add missing migration #11865

Merged
merged 2 commits into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,16 @@ public function theVariantWithCodeShouldBePricedAtForChannel(ProductVariantInter
}

/**
* @Then /^the (variant with code "[^"]+") should be originally priced at (?:€|£|\$)([^"]+) for channel "([^"]+)"$/
* @Then /^the (variant with code "[^"]+") should be originally priced at (?:€|£|\$)([^"]+) for (channel "[^"]+")$/
*/
public function theVariantWithCodeShouldBeOriginalPricedAtForChannel(
ProductVariantInterface $productVariant,
string $price,
string $channelName
ChannelInterface $channel
): void {
$this->updatePage->open(['id' => $productVariant->getId(), 'productId' => $productVariant->getProduct()->getId()]);

Assert::same($this->updatePage->getOriginalPriceForChannel($channelName), $price);
Assert::same($this->updatePage->getOriginalPriceForChannel($channel), $price);
}

/**
Expand Down Expand Up @@ -578,16 +578,16 @@ public function iShouldNotHaveConfiguredPriceForChannel(ChannelInterface $channe
}

/**
* @Then I should have original price equal to :price in :channelName channel
* @Then I should have original price equal to :price in :channel channel
*/
public function iShouldHaveOriginalPriceEqualInChannel(string $price, string $channelName): void
public function iShouldHaveOriginalPriceEqualInChannel(string $price, ChannelInterface $channel): void
{
/** @var ProductVariantInterface $product */
$productVariant = $this->sharedStorage->get('variant');

$this->updatePage->open(['productId' => $productVariant->getProduct()->getId(), 'id' => $productVariant->getId()]);

Assert::contains($price, $this->updatePage->getOriginalPriceForChannel($channelName));
Assert::contains($price, $this->updatePage->getOriginalPriceForChannel($channel));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,11 +1137,11 @@ public function iShouldNotHaveConfiguredPriceForChannel(ChannelInterface $channe
}

/**
* @Then I should have original price equal to :price in :channelName channel
* @Then I should have original price equal to :price in :channel channel
*/
public function iShouldHaveOriginalPriceEqualInChannel(string $price, string $channelName): void
public function iShouldHaveOriginalPriceEqualInChannel(string $price, ChannelInterface $channel): void
{
Assert::contains($price, $this->updateSimpleProductPage->getOriginalPriceForChannel($channelName));
Assert::contains($price, $this->updateSimpleProductPage->getOriginalPriceForChannel($channel));
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Sylius\Bundle\CoreBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20200916093101 extends AbstractMigration
{
public function getDescription(): string
{
return 'Make a price on channel pricing nullable';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE sylius_channel_pricing CHANGE price price INT DEFAULT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE sylius_channel_pricing CHANGE price price INT NOT NULL');
}
}