LineItemGroupPackagerNotFoundException example

#[Package('checkout')] class LineItemGroupPackagerNotFoundExceptionTest extends TestCase
{
    /** * This test verifies that our provided code is correctly * visible in the resulting exception message. * * @group lineitemgroup */
    public function testCodeInMessage(): void
    {
        $exception = new LineItemGroupPackagerNotFoundException('COUNT');

        static::assertEquals('Packager "COUNT" has not been found!', $exception->getMessage());
    }

    /** * This test verifies that our error code is correct * * @group lineitemgroup */
    public function testErrorCode(): void
    {
        

    public function getPackager(string $key): LineItemGroupPackagerInterface
    {
        /** @var LineItemGroupPackagerInterface $packager */
        foreach ($this->packagers as $packager) {
            if (mb_strtolower($packager->getKey()) === mb_strtolower($key)) {
                return $packager;
            }
        }

        throw new LineItemGroupPackagerNotFoundException($key);
    }

    /** * Gets a list of all registered sorters. */
    public function getSorters(): \Generator
    {
        foreach ($this->sorters as $sorter) {
            yield $sorter;
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.