public function validate($value, Constraint $constraint) { $verb = new KnowExtensionVerb(); $verb->setFormat($value); $exec = new Command(); $result = $exec->execute($verb); if (!$result->isSuccess()) { $this->context->addViolation($constraint->message, array('%ext%' => $value)); } }
public function validate($value, Constraint $constraint) { $verb = new ListExportVerb(); $exec = new Command(); $result = $exec->execute($verb); if ($result->isSuccess()) { if (!in_array($value, $result->getOutput())) { $this->context->addViolation($constraint->message, array('%ext%' => $value)); } } }
public function validate($value, Constraint $constraint) { $verb = new VersionVerb(); $exec = new Command(); $result = $exec->execute($verb); if ($result->isSuccess()) { $version = $result->getOutputLine(0); if (!version_compare($value, $version, '>=')) { $this->context->addViolation($constraint->message, array('%version%' => $value, '%available_version%' => $version)); } } }
/** * @covers Assimp\Command\Command::setBinary * @expectedException \InvalidArgumentException */ public function testSetBinaryFailure() { $this->object->setBinary('/usr/local/bin/assimp'); }