/** * Puzzle constructor. * * @param string $name The puzzle name * @param string[] $parts The different puzzle parts in a 'method' => 'output format' array */ public function __construct(string $name, array $parts) { $this->name = $name; foreach ($parts as $method => $format) { Assertion::methodExists($method, $this, sprintf("Could not find part '%s' method in %s", $method, get_called_class())); Assertion::string($format); } $this->parts = $parts; }
public function testMethodExists() { Assertion::methodExists('methodExists', new Assertion()); }