protected function _compareConstraints(array $fixtureConstraints, array $liveConstraints, $fixtureTable) {
		if (!$fixtureConstraints && !$liveConstraints) {
			return;
		}

		$fixtureConstraints = $this->normalizeConstraints($fixtureConstraints);
		$liveConstraints = $this->normalizeConstraints($liveConstraints);

		if ($fixtureConstraints === $liveConstraints) {
			return;
		}

		$errors = [];
		foreach ($liveConstraints as $key => $liveConstraint) {
			if (!isset($fixtureConstraints[$key])) {
				$errors[] = ' * ' . sprintf('Constraint %s is missing in fixture, but in live DB.', $this->_buildKey($key, $liveConstraint));
				continue;
			}

			if ($liveConstraint === $fixtureConstraints[$key]) {
				unset($fixtureConstraints[$key]);
				continue;
			}

			$errors[] = ' * ' . sprintf('Live DB constraint %s is not matching fixture one: %s.', $this->_buildKey($key, $liveConstraint), json_encode($fixtureConstraints[$key], true));
			unset($fixtureConstraints[$key]);
		}

		foreach ($fixtureConstraints as $key => $fixtureConstraint) {
			$errors[] = ' * ' . sprintf('Constraint %s is in fixture, but not live DB.', $this->_buildKey($key, $fixtureConstraint));
		}

		if (!$errors) {
			return;
		}

		$this->warn('The following constraints mismatch:');

		$this->out($errors);
		$this->_issuesFound[] = $fixtureTable;
		$this->out($this->nl(0));
	}
protected function _compareConstraints(array $fixtureConstraints, array $liveConstraints, $fixtureTable) {
		if (!$fixtureConstraints && !$liveConstraints) {
			return;
		}

		$fixtureConstraints = $this->normalizeConstraints($fixtureConstraints);
		$liveConstraints = $this->normalizeConstraints($liveConstraints);

		if ($fixtureConstraints === $liveConstraints) {
			return;
		}

		$errors = [];
		foreach ($liveConstraints as $key => $liveConstraint) {
			if (!isset($fixtureConstraints[$key])) {
				$errors[] = ' * ' . sprintf('Constraint %s is missing in fixture, but in live DB.', $this->_buildKey($key, $liveConstraint));
				continue;
			}

			if ($liveConstraint === $fixtureConstraints[$key]) {
				unset($fixtureConstraints[$key]);
				continue;
			}

			$errors[] = ' * ' . sprintf('Live DB constraint %s is not matching fixture one: %s.', $this->_buildKey($key, $liveConstraint), json_encode($fixtureConstraints[$key], true));
			unset($fixtureConstraints[$key]);
		}

		foreach ($fixtureConstraints as $key => $fixtureConstraint) {
			$errors[] = ' * ' . sprintf('Constraint %s is in fixture, but not live DB.', $this->_buildKey($key, $fixtureConstraint));
		}

		if (!$errors) {
			return;
		}

		$this->warn('The following constraints mismatch:');

		$this->out($errors);
		$this->_issuesFound[] = $fixtureTable;
		$this->out($this->nl(0));
	}
protected function _compareConstraints ( array $ fixtureConstraints , array $ liveConstraints , $ fixtureTable ) { if ( ! $ fixtureConstraints && ! $ liveConstraints ) { return ; } $ fixtureConstraints = $ this -> normalizeConstraints ( $ fixtureConstraints ) ; $ liveConstraints = $ this -> normalizeConstraints ( $ liveConstraints ) ; if ( $ fixtureConstraints === $ liveConstraints ) { return ; } $ errors = [ ] ; foreach ( $ liveConstraints as $ key => $ liveConstraint ) { if ( ! isset ( $ fixtureConstraints [ $ key ] ) ) { $ errors [ ] = ' * ' . sprintf ( 'Constraint %s is missing in fixture, but in live DB.' , $ this -> _buildKey ( $ key , $ liveConstraint ) ) ; continue ; } if ( $ liveConstraint === $ fixtureConstraints [ $ key ] ) { unset ( $ fixtureConstraints [ $ key ] ) ; continue ; } $ errors [ ] = ' * ' . sprintf ( 'Live DB constraint %s is not matching fixture one: %s.' , $ this -> _buildKey ( $ key , $ liveConstraint ) , json_encode ( $ fixtureConstraints [ $ key ] , true ) ) ; unset ( $ fixtureConstraints [ $ key ] ) ; } foreach ( $ fixtureConstraints as $ key => $ fixtureConstraint ) { $ errors [ ] = ' * ' . sprintf ( 'Constraint %s is in fixture, but not live DB.' , $ this -> _buildKey ( $ key , $ fixtureConstraint ) ) ; } if ( ! $ errors ) { return ; } $ this -> warn ( 'The following constraints mismatch:' ) ; $ this -> out ( $ errors ) ; $ this -> _issuesFound [ ] = $ fixtureTable ; $ this -> out ( $ this -> nl ( 0 ) ) ; }
Compare the constraints present.

@param array $fixtureConstraints
@param array $liveConstraints
@param string $fixtureTable

@return void
Compare the constraints present .