~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/date/tests/DateTime_getOffset_error.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Test DateTime::getOffset() function : error conditions 
 
3
--FILE--
 
4
<?php
 
5
 
 
6
/* Prototype  : public int DateTime::getOffset  ( void  )
 
7
 * Description: Returns the daylight saving time offset
 
8
 * Source code: ext/date/php_date.c
 
9
 * Alias to functions:  date_offset_get
 
10
 */
 
11
 
 
12
 //Set the default time zone 
 
13
date_default_timezone_set("Europe/London");
 
14
 
 
15
echo "*** Testing DateTime::getOffset() : error conditions ***\n";
 
16
 
 
17
echo "\n-- Testing DateTime::getOffset() function with more than expected no. of arguments --\n";
 
18
$datetime = new DateTime("2009-01-30 19:34:10");
 
19
$extra_arg = 30;
 
20
 
 
21
var_dump( $datetime->getOffset($extra_arg) );
 
22
 
 
23
?>
 
24
===DONE===
 
25
--EXPECTF--
 
26
*** Testing DateTime::getOffset() : error conditions ***
 
27
 
 
28
-- Testing DateTime::getOffset() function with more than expected no. of arguments --
 
29
 
 
30
Warning: DateTime::getOffset() expects exactly 0 parameters, 1 given in %s on line %d
 
31
bool(false)
 
32
===DONE===
 
33