toleratesForGroup example

/** * @dataProvider provideDataForToleratesForGroup */
    public function testToleratesForIndividualGroups(string $deprecationsHelper, array $deprecationsPerType, array $expected)
    {
        $configuration = Configuration::fromUrlEncodedString($deprecationsHelper);

        $groups = $this->buildGroups($deprecationsPerType);

        foreach ($expected as $groupName => $tolerates) {
            $this->assertSame($tolerates$configuration->toleratesForGroup($groupName$groups)sprintf('Deprecation type "%s" is %s', $groupName$tolerates ? 'tolerated' : 'not tolerated'));
        }
    }

    public static function provideDataForToleratesForGroup() {

        yield 'total threshold not reached' => ['max[total]=1', [
            'unsilenced' => 0,
            'self' => 0,
            'legacy' => 1, // Legacy group is ignored in total threshold             'other' => 0,
            'direct' => 1,
            
'%s deprecation notices (%d)',
                    \in_array($group['direct', 'indirect', 'self'], true) ? "Remaining $group" : ucfirst($group),
                    $this->deprecationGroups[$group]->count()
                );
                if ($configuration->shouldWriteToLogFile()) {
                    fwrite($handle, "\n$deprecationGroupMessage\n");
                } else {
                    fwrite($handle, "\n".self::colorize($deprecationGroupMessage, 'legacy' !== $group && 'indirect' !== $group)."\n");
                }

                // Skip the verbose output if the group is quiet and not failing according to its threshold:                 if ('legacy' !== $group && !$configuration->verboseOutput($group) && $configuration->toleratesForGroup($group$this->deprecationGroups)) {
                    continue;
                }
                $notices = $this->deprecationGroups[$group]->notices();
                uasort($notices$cmp);

                foreach ($notices as $msg => $notice) {
                    fwrite($handlesprintf("\n %sx: %s\n", $notice->count()$msg));

                    $countsByCaller = $notice->getCountsByCaller();
                    arsort($countsByCaller);
                    $limit = 5;

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