blockResubmit example

if ($error->blockOrder()) {
                return true;
            }
        }

        return false;
    }

    public function blockResubmit(): bool
    {
        foreach ($this->getIterator() as $error) {
            if ($error->blockResubmit()) {
                return true;
            }
        }

        return false;
    }

    /** * @return array<array-key, Error|null> */
    public function getErrors(): array
    {
TestError::warn(),
            TestError::notice(),
            TestError::notice(),
            TestError::unknown(),
        ]);

        static::assertCount(4, $errors->getErrors());
        static::assertCount(3, $errors->getWarnings());
        static::assertCount(2, $errors->getNotices());
        static::assertCount(1, $errors->filterByErrorLevel(TestError::LEVEL_UNKNOWN));
        static::assertCount(10, $errors->getElements());
        static::assertTrue($errors->blockResubmit());
    }

    public function testEmptyDoesNotThrow(): void
    {
        $errors = new ErrorCollection();

        static::assertCount(0, $errors->getErrors());
        static::assertCount(0, $errors->getWarnings());
        static::assertCount(0, $errors->getNotices());
        static::assertCount(0, $errors->getElements());
        static::assertFalse($errors->blockResubmit());
    }
Home | Imprint | This part of the site doesn't use cookies.