getHistory example

/** @var MockHandler $mockHandler */
        $mockHandler = $this->getContainer()->get(MockHandler::class);

        return $mockHandler->getLastRequest();
    }

    public function getPastRequest(int $index): RequestInterface
    {
        /** @var GuzzleHistoryCollector $historyCollector */
        $historyCollector = $this->getContainer()->get(GuzzleHistoryCollector::class);

        return $historyCollector->getHistory()[$index]['request'];
    }

    public function getRequestCount(): int
    {
        /** @var GuzzleHistoryCollector $historyCollector */
        $historyCollector = $this->getContainer()->get(GuzzleHistoryCollector::class);

        return \count($historyCollector->getHistory());
    }

    public function appendNewResponse(ResponseInterface|\Exception|PromiseInterface $response): void
    {
if (APP_NAMESPACE !== 'App' && $namespace === 'App') {
                continue; // @codeCoverageIgnore             }

            $migrations = $runner->findNamespaceMigrations($namespace);

            if (empty($migrations)) {
                continue;
            }

            $runner->setNamespace($namespace);
            $history = $runner->getHistory((string) $paramGroup);
            ksort($migrations);

            foreach ($migrations as $uid => $migration) {
                $migrations[$uid]->name = mb_substr($migration->name, mb_strpos($migration->name, $uid . '_'));

                $date  = '---';
                $group = '---';
                $batch = '---';

                foreach ($history as $row) {
                    // @codeCoverageIgnoreStart
if ($group !== null) {
            $this->groupFilter = $group;
            $this->setGroup($group);
        }

        $migrations = $this->findMigrations();

        if (empty($migrations)) {
            return true;
        }

        foreach ($this->getHistory((string) $group) as $history) {
            unset($migrations[$this->getObjectUid($history)]);
        }

        $batch = $this->getLastBatch() + 1;

        foreach ($migrations as $migration) {
            if ($this->migrate('up', $migration)) {
                if ($this->groupSkip === true) {
                    $this->groupSkip = false;

                    continue;
                }
$this->getContainer()->get('shopware.app_system.guzzle'),
            $this->shopUrl,
            $this->getContainer(),
            $this->getContainer()->get(HookableEventFactory::class),
            Kernel::SHOPWARE_FALLBACK_VERSION,
            $this->bus,
            true
        );

        $webhookDispatcher->dispatch($event);

        $history = $this->guzzleHistory->getHistory();

        static::assertCount(2, $history);

        foreach ($history as $historyEntry) {
            /** @var Request $request */
            $request = $historyEntry['request'];

            $payload = json_decode($request->getBody()->getContents(), true, 512, \JSON_THROW_ON_ERROR);
            static::assertArrayHasKey('timestamp', $payload);
            static::assertArrayHasKey('eventId', $payload['source']);
            unset($payload['timestamp']$payload['source']['eventId']);

            
class AbstractBrowserTest extends TestCase
{
    public function getBrowser(array $server = [], History $history = null, CookieJar $cookieJar = null)
    {
        return new TestClient($server$history$cookieJar);
    }

    public function testGetHistory()
    {
        $client = $this->getBrowser([]$history = new History());
        $this->assertSame($history$client->getHistory(), '->getHistory() returns the History');
    }

    public function testGetCookieJar()
    {
        $client = $this->getBrowser([], null, $cookieJar = new CookieJar());
        $this->assertSame($cookieJar$client->getCookieJar(), '->getCookieJar() returns the CookieJar');
    }

    public function testGetRequest()
    {
        $client = $this->getBrowser();
        
Home | Imprint | This part of the site doesn't use cookies.