Merge the fixture with any potential overrides.

@param  string $name
@param  array  $attributes
@return array
@throws TestDummyException
973637
protected function getAttributes($name, array $attributes)
    {
        $attributes = $this->filterRelationshipAttributes($attributes);

        $factory = $this->triggerFakerOnAttributes(
            $this->getFixture($name)->attributes
        );

        return array_merge($factory, $attributes);
    }
542175
public function addTextarea($name, $attributes = array()) {
	
		$control = new FormControlTextarea($name, $attributes);
		$this->addControl($control);
	
		return $control;
	
	}
1173471
protected function validate(array $attributes, string $name, array $parameters = []): bool
    {
        $callback = $this->callback;

        if (($result = $callback($attributes, $name, $parameters)) === false) {
            $this->addError($name, $parameters, 'verification failed');
        }

        unset($callback);

        return $result;
    }
1230016
public function addMeta ($name, $content, $attributes = array())
		{
			$html = '<meta name="' . $this->sanitize($name) . '" content="' . $this->sanitize($content) . '"';

			foreach ($attributes as $key => $value) {
				$html .= ' ' . $this->sanitize($key) . '="' . $this->sanitize($value) . '"';
			}

			$html .= ' />';

			$this->addHeader($html);
		}
848274
public function withAttributes(array $attributes)
    {
        $clone = clone $this;

        foreach ($attributes as $name => $value) {
            $clone->dom->documentElement->setAttribute($name, $value);
        }

        return $clone;
    }
555453
public function changeField($name, array $attributes)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $this->changeFields[$name] = $attributes;
        return $this;
    }
251311
public function addFilter($name, $attributes = array())
    {
        // name is "filtername:method:alias".
        $names = explode(':', $name);
        $filter = array_shift($names);
        $method = array_shift($names);
        $alias = array_shift($names);
        if (! $alias) $alias = $filter;
        if (! is_array($attributes)) $attributes = [];

        // method miss match, when return.
        if ($method && strtoupper($method) !== $this->Request->getMethod()) return;

        // register.
        if (isset($this->filters[$alias])) {
            $this->filters[$alias]['attributes'] = $this->arrayUtil->merge($this->filters[$alias]['attributes'], $attributes);
        } else {
            $this->filter_names[] = $alias;
            $this->filters[$alias] = array('name' => $filter, 'attributes' => (array)$attributes);
        }

        // if action filter.
        if (strtolower($filter) === 'action') {
            $this->has_action_filter = true;
        }
    }
1092179
public function attributes($attributes)
    {
        if (is_array($this->attributes) and is_array($attributes)) {
            $attributes = array_merge($this->attributes, $attributes);
        }
        $this->attributes = $attributes;

        return $this;
    }
1237383
public function display($name = null, array $attributes = [])
    {
        return Div::make()->attributes(array_merge(
            static::prepareNameAttribute($name),
            $this->prepareAttributes($attributes)
        ));
    }
1296393
protected function mergeAttributes(array $defaultAttributes, array $newAttributes)
	{
		$attributes = array_merge($defaultAttributes, $newAttributes);
		if (isset($defaultAttributes['style'], $newAttributes['style']))
		{
			// Re-add the default attributes that were lost (but not replaced) in the merge
			$attributes['style'] += $defaultAttributes['style'];
		}

		return $attributes;
	}
902439
public function addJs($name, $attributes = [])
    {
        if (is_array($name)) {
            $name = $this->combineAssets($name, $this->getLocalPath($this->assetPath));
        }

        $jsPath = $this->getAssetPath($name);

        if (isset($this->controller)) {
            $this->controller->addJs($jsPath, $attributes);
        }

        if (is_string($attributes)) {
            $attributes = ['build' => $attributes];
        }

        $jsPath = $this->getAssetScheme($jsPath);

        if (!in_array($jsPath, $this->assets['js'])) {
            $this->assets['js'][] = ['path' => $jsPath, 'attributes' => $attributes];
        }
    }
380898
private function appendOldAttributes(array $attributes)
    {
        // Get a current collection
        $collection = $this->sessionBag->get(self::PARAM_STORAGE_KEY);

        // Merge new attributes with collection
        $collection = array_merge($collection, $attributes);

        // Override old collection with a new one
        $this->sessionBag->set(self::PARAM_STORAGE_KEY, $collection);
    }
1083240
public function css($name, $attributes = [])
    {
        $this->getLayout()->css($name, $attributes)->attachTo($this);
        return $this;
    }
45747
public static function getScoreboardIcon( string $name, array $attributes = [] ): Html
	{
		self::checkInit();

		$attrs = array_merge([ 'alt' => $name ], self::getSetting(self::SET_CUSTOM_IMG_ATTRS, []), $attributes);
		$attrs['class'] = implode(' ', [
			self::getSetting(self::SET_DEFAULT_CLASS),
			self::getSetting(self::SET_UI_ICON_CLASS),
			@self::getSetting(self::SET_CUSTOM_IMG_ATTRS, [])['class'],
			@$attributes['class'],
		]);
		$attrs['src'] = self::getScoreboardIconUrl($name);

		return Html::el('img', $attrs);
	}
1336635
public function merge(Validation $validation, $name = '') {
        $paths = $validation->errors;

        foreach ($paths as $path => $errors) {
            foreach ($errors as $error) {
                if (strlen($name) > 0) {
                    // We are merging a sub-schema error that did not occur on a particular property of the sub-schema.
                    if ($path === '') {
                        $fullPath = $name;
                    } else {
                        $fullPath = "{$name}/{$path}";
                    }
                    $this->addError($fullPath, $error['error'], $error);
                }
            }
        }
        return $this;
    }
14082
public function startElement($name, $attributes)
    {
        try {
            if ($name == "dataset") {
                // Clear any start/end DLL
                call_user_func(array($this->builderClazz, 'reset'));
                $this->sqlWriter->write(call_user_func(array($this->builderClazz, 'getDatabaseStartSql')));
            } else {

                // we're processing a row of data
                // where tag name is phpName e.g. <BookReader .... />

                $table = $this->database->getTableByPhpName($name);

                $columnValues = array();
                foreach ($attributes as $name => $value) {
                    $col = $table->getColumnByPhpName($name);
                    $columnValues[] = new ColumnValue($col, iconv('utf-8', $this->encoding, $value));
                }

                $data = new DataRow($table, $columnValues);

                if ($this->currTableName !== $table->getName()) {
                    // new table encountered

                    if ($this->currBuilder !== null) {
                        $this->sqlWriter->write($this->currBuilder->getTableEndSql());
                    }

                    $this->currTableName = $table->getName();
                    $this->currBuilder = $this->generatorConfig->getConfiguredBuilder($table, 'datasql');

                    $this->sqlWriter->write($this->currBuilder->getTableStartSql());
                }

                // Write the SQL
                $this->sqlWriter->write($this->currBuilder->buildRowSql($data));
            }
        } catch (Exception $e) {
            // Exceptions have traditionally not bubbled up nicely from the expat parser,
            // so we also print the stack trace here.
            print $e;
            throw $e;
        }
    }
919603
public function addForeign($name, array $attributes = [])
    {
        if ($this->scope == 'alter') {
            $command = 'ADD ';
        } else {
            $command = '';
        }

        $on = '';
        $references = '';

        if (isset($attributes['on'])) {
            $on = strtoupper(' ON ' .$attributes['on']);
        }

        if (isset($attributes['references'])) {
            $references = sprintf(
                ' REFERENCES %s(%s)',
                $attributes['table'],
                $attributes['references']
            );
        }

        $sql = sprintf(
            '%sFOREIGN KEY (`%s`)%s%s',
            $command,
            $name,
            $references,
            $on
        );

        $this->sqls[] = $sql;

        return $this;
    }