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

Phalcon\Registry #1935

Merged
merged 9 commits into from Jan 31, 2014
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Test case
  • Loading branch information
sjinks committed Jan 30, 2014
commit b34ac43ab9fc21c6f3b73becde433d3ae9f5b4c9
34 changes: 34 additions & 0 deletions ext/tests/issue-1935.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
--TEST--
Phalcon\Registry - https://github.com/phalcon/cphalcon/pull/1935
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
$registry = new \Phalcon\Registry();
$registry['a'] = 1;
$registry->b = 2;
assert($registry->a === $registry['a'] && $registry->a === 1);
assert($registry->b === $registry['b'] && $registry->b === 2);
assert(isset($registry->a));
assert(isset($registry['a']));
assert(!isset($registry->c));
assert(!isset($registry['c']));
$registry['c'] = 3;
assert(count($registry) == 3);
unset($registry->b);
unset($registry['c']);
assert(!isset($registry->b));
assert(!isset($registry['b']));

foreach ($registry as $key => $value) {
assert($key === 'a');
assert($value === 1);
}

$s = serialize($registry);
$copy = unserialize($s);

assert($registry == $copy);

?>
--EXPECT--