root / trunk / ext / php / phpunit-tests / helpers.php

Revision 279, 0.5 kB (checked in by indeyets, 14 months ago)

- changed naming of tags to php/(object|array|hash)::ClassName?
- added ability to emit Serializable objects

Line 
1<?php
2
3class SyckTestSomeClass {}
4
5class MySerializable implements Serializable
6{
7    private $string = null;
8
9    public function __construct($string = null)
10    {
11        if (null === $string)
12            throw new Exception('This is not supposed to be called implicitly');
13
14        $this->string = $string;
15    }
16
17    public function serialize()
18    {
19        return $this->string;
20    }
21
22    public function unserialize($string)
23    {
24        $this->string = $string;
25    }
26
27    public function test()
28    {
29        return $this->string;
30    }
31}
Note: See TracBrowser for help on using the browser.