Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for read-only transactions and transaction options #773

Merged
merged 1 commit into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Core/Testing/StubTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function ___getProperty($prop)
public function ___setProperty($prop, $value)
{
if (!in_array($prop, json_decode($this->___props))) {
throw new \BadMethodCallException(sprintf('Property %s cannot be overloaded', $prop));
throw new \RuntimeException(sprintf('Property %s cannot be overloaded', $prop));
}

$property = $this->___getPropertyReflector($prop);
Expand Down
6 changes: 4 additions & 2 deletions src/Core/Testing/TestHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public static function stub($extends, array $args = [], array $props = [])

$tpl = 'class %s extends %s {private $___props = \'%s\'; use \Google\Cloud\Core\Testing\StubTrait; }';

$name = 'Stub' . sha1($extends);
$props = json_encode($props);

$name = 'Stub' . sha1($extends . $props);

if (!class_exists($name)) {
eval(sprintf($tpl, $name, $extends, json_encode($props)));
eval(sprintf($tpl, $name, $extends, $props));
}

$reflection = new \ReflectionClass($name);
Expand Down
Loading