Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
Add APCu test
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Nov 10, 2013
1 parent a13888f commit 47f4417
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ option must be given to configure script: "--with-php-config=.../php-config5"
5. `make install`
6. igbinary.so is installed to the default extension directory

### To run APCu test

```
# go to modules directory
cd modules
# ... and create symlink to apcu extension
# it will be loaded during test suite
/opt/lib/php/extensions/no-debug-non-zts-20121212/apcu.so
```

Similar approach should work for APC.

Bugs & Contributions
--------------------

Expand Down
1 change: 1 addition & 0 deletions tests/igbinary_045.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (version_compare($ext->getVersion(), '3.1.7', '<')) {
}

--INI--
extension=apc.so
apc.enable_cli=1
apc.serializer=igbinary
--FILE--
Expand Down
36 changes: 36 additions & 0 deletions tests/igbinary_045b.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--TEST--
APCu serializer registration
--SKIPIF--
<?php
if (!extension_loaded('apcu')) {
echo "skip APCu not loaded";
}

$ext = new ReflectionExtension('apcu');
if (version_compare($ext->getVersion(), '4.0.2', '<')) {
echo "skip require APCu version 4.0.2 or above";
}

--INI--
extension=apcu.so
apc.enable_cli=1
apc.serializer=igbinary
--FILE--
<?php
echo ini_get('apc.serializer'), "\n";

class Bar {
public $foo = 10;
}

$a = new Bar;
apc_store('foo', $a);
unset($a);

var_dump(apc_fetch('foo'));
--EXPECTF--
igbinary
object(Bar)#%d (1) {
["foo"]=>
int(10)
}

0 comments on commit 47f4417

Please sign in to comment.