File: singleton.phpt

package info (click to toggle)
php-log 1.10.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 404 kB
  • ctags: 592
  • sloc: php: 1,822; xml: 237; sql: 8; makefile: 3
file content (22 lines) | stat: -rw-r--r-- 407 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Log: Singleton
--FILE--
<?php

require_once 'Log.php';

$console1 = &Log::singleton('console');
$console2 = &Log::singleton('console');

if (is_a($console1, 'Log_console') && is_a($console2, 'Log_console'))
{
	echo "Two Log_console objects.\n";
}

if ($console1->_id == $console2->_id) {
	echo "The objects have the same ID.\n";
}

--EXPECT--
Two Log_console objects.
The objects have the same ID.