From d3d9a5b35452feecd0b4479bc9519ab322812282 Mon Sep 17 00:00:00 2001 From: donnut Date: Sun, 24 Jun 2012 06:30:24 +0000 Subject: [PATCH 1/4] new tests from PHP TestFest June 2012 --- .../tests/SplFileObject_current_basic.phpt | 18 +++++++++ .../tests/SplFileObject_current_error001.phpt | 19 +++++++++ .../SplFileObject_current_variation001.phpt | 21 ++++++++++ .../tests/SplFileObject_getflags_basic.phpt | 22 ++++++++++ .../SplFileObject_getflags_error001.phpt | 26 ++++++++++++ .../SplFileObject_getflags_variation001.phpt | 40 +++++++++++++++++++ ext/spl/tests/SplFileObject_key_basic.phpt | 19 +++++++++ ext/spl/tests/SplFileObject_key_error001.phpt | 22 ++++++++++ ext/spl/tests/SplFileObject_key_error002.phpt | 22 ++++++++++ ext/spl/tests/SplFileObject_next_basic.phpt | 22 ++++++++++ .../SplFileObject_next_variation001.phpt | 24 +++++++++++ ext/spl/tests/SplFileObject_rewind_basic.phpt | 21 ++++++++++ .../tests/SplFileObject_rewind_error001.phpt | 18 +++++++++ .../SplFileObject_rewind_variation001.phpt | 28 +++++++++++++ ext/spl/tests/SplFileObject_seek_basic.phpt | 19 +++++++++ .../tests/SplFileObject_seek_error002.phpt | 18 +++++++++ 16 files changed, 359 insertions(+) create mode 100644 ext/spl/tests/SplFileObject_current_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_current_error001.phpt create mode 100644 ext/spl/tests/SplFileObject_current_variation001.phpt create mode 100644 ext/spl/tests/SplFileObject_getflags_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_getflags_error001.phpt create mode 100644 ext/spl/tests/SplFileObject_getflags_variation001.phpt create mode 100644 ext/spl/tests/SplFileObject_key_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_key_error001.phpt create mode 100644 ext/spl/tests/SplFileObject_key_error002.phpt create mode 100644 ext/spl/tests/SplFileObject_next_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_next_variation001.phpt create mode 100644 ext/spl/tests/SplFileObject_rewind_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_rewind_error001.phpt create mode 100644 ext/spl/tests/SplFileObject_rewind_variation001.phpt create mode 100644 ext/spl/tests/SplFileObject_seek_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_seek_error002.phpt diff --git a/ext/spl/tests/SplFileObject_current_basic.phpt b/ext/spl/tests/SplFileObject_current_basic.phpt new file mode 100644 index 0000000000000..d3f4802a53896 --- /dev/null +++ b/ext/spl/tests/SplFileObject_current_basic.phpt @@ -0,0 +1,18 @@ +--TEST-- +SPL: SplFileObject::current basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +current(); + +?> +--EXPECT-- + +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(2); + +echo $s->current('foo'); +?> +--EXPECTF-- +Warning: SplFileObject::current() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_current_variation001.phpt b/ext/spl/tests/SplFileObject_current_variation001.phpt new file mode 100644 index 0000000000000..0cc588a7f0478 --- /dev/null +++ b/ext/spl/tests/SplFileObject_current_variation001.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::current variation +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(2); + +echo $s->current(); +echo $s->current(); +?> +--EXPECT-- +//line 3 +//line 3 diff --git a/ext/spl/tests/SplFileObject_getflags_basic.phpt b/ext/spl/tests/SplFileObject_getflags_basic.phpt new file mode 100644 index 0000000000000..5addadf38046e --- /dev/null +++ b/ext/spl/tests/SplFileObject_getflags_basic.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::getFlags basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +setFlags(SplFileObject::DROP_NEW_LINE); +var_dump($fo->getFlags()); +?> +--CLEAN-- + +--EXPECT-- +int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error001.phpt b/ext/spl/tests/SplFileObject_getflags_error001.phpt new file mode 100644 index 0000000000000..1602f88885e11 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getflags_error001.phpt @@ -0,0 +1,26 @@ +--TEST-- +SPL: SplFileObject::getFlags error 001 +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +setFlags(SplFileObject::READ_CSV); + +$fo->setFlags(SplFileObject::DROP_NEW_LINE); + +var_dump($fo->getFlags()); + +?> +--CLEAN-- + +--EXPECT-- +int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_variation001.phpt b/ext/spl/tests/SplFileObject_getflags_variation001.phpt new file mode 100644 index 0000000000000..30e598465c74f --- /dev/null +++ b/ext/spl/tests/SplFileObject_getflags_variation001.phpt @@ -0,0 +1,40 @@ +--TEST-- +SPL: SplFileObject::getFlags +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +setFlags(SplFileObject::DROP_NEW_LINE); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::READ_AHEAD); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::SKIP_EMPTY); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::READ_CSV); +var_dump($fo->getFlags()); + +?> +--EXPECT-- +int(1) +int(2) +int(4) +int(8) diff --git a/ext/spl/tests/SplFileObject_key_basic.phpt b/ext/spl/tests/SplFileObject_key_basic.phpt new file mode 100644 index 0000000000000..4081d314eaf04 --- /dev/null +++ b/ext/spl/tests/SplFileObject_key_basic.phpt @@ -0,0 +1,19 @@ +--TEST-- +SPL: SplFileObject::key basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(3); +echo $s->key(); +?> +--EXPECT-- +3 diff --git a/ext/spl/tests/SplFileObject_key_error001.phpt b/ext/spl/tests/SplFileObject_key_error001.phpt new file mode 100644 index 0000000000000..b0834f00290ae --- /dev/null +++ b/ext/spl/tests/SplFileObject_key_error001.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(12); +$s->next(); +var_dump($s->key()); +var_dump($s->valid()); +?> +--EXPECT-- +int(13) +bool(false) diff --git a/ext/spl/tests/SplFileObject_key_error002.phpt b/ext/spl/tests/SplFileObject_key_error002.phpt new file mode 100644 index 0000000000000..8fc9b7fef0a58 --- /dev/null +++ b/ext/spl/tests/SplFileObject_key_error002.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(120); +$s->next(); +var_dump($s->key()); +var_dump($s->valid()); +?> +--EXPECT-- +int(13) +bool(false) diff --git a/ext/spl/tests/SplFileObject_next_basic.phpt b/ext/spl/tests/SplFileObject_next_basic.phpt new file mode 100644 index 0000000000000..59dc7ab58d67a --- /dev/null +++ b/ext/spl/tests/SplFileObject_next_basic.phpt @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::next basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +current(); +$s->next(); + +echo $s->current(); + +?> +--EXPECT-- + +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(13); +echo $s->current(); + +$s->next(); +echo $s->current(); +var_dump($s->valid()); +?> +--EXPECT-- +?> +bool(false) diff --git a/ext/spl/tests/SplFileObject_rewind_basic.phpt b/ext/spl/tests/SplFileObject_rewind_basic.phpt new file mode 100644 index 0000000000000..331c587e4a24b --- /dev/null +++ b/ext/spl/tests/SplFileObject_rewind_basic.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::rewind basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(3); + +$s->rewind(); +echo $s->current(); +?> +--EXPECT-- + +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +rewind( "invalid" ); + +?> +--EXPECTF-- +Warning: SplFileObject::rewind() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_rewind_variation001.phpt b/ext/spl/tests/SplFileObject_rewind_variation001.phpt new file mode 100644 index 0000000000000..d835c443de178 --- /dev/null +++ b/ext/spl/tests/SplFileObject_rewind_variation001.phpt @@ -0,0 +1,28 @@ +--TEST-- +SPL: SplFileObject::rewind variation 001 +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(15); +echo $s->current(); +$s->next(); +echo $s->current(); +var_dump($s->valid()); +$s->rewind(); +var_dump($s->valid()); +echo $s->current(); +?> +--EXPECT-- +?> +bool(false) +bool(true) + +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(2); +echo $s->current(); +?> +--EXPECT-- +//line 3 diff --git a/ext/spl/tests/SplFileObject_seek_error002.phpt b/ext/spl/tests/SplFileObject_seek_error002.phpt new file mode 100644 index 0000000000000..057c8d3251aeb --- /dev/null +++ b/ext/spl/tests/SplFileObject_seek_error002.phpt @@ -0,0 +1,18 @@ +--TEST-- +SPL: SplFileObject::seek error 001 +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(20); +echo $s->current(); +?> +--EXPECT-- From a476ff48be914f0a70cca2def9bdc5b7a5e579ba Mon Sep 17 00:00:00 2001 From: donnut Date: Sun, 24 Jun 2012 10:41:29 +0000 Subject: [PATCH 2/4] addition SplFileObject tests --- .../SplFileObject_getchildren_basic.phpt | 14 ++++++++ .../SplFileObject_getchildren_error001.phpt | 14 ++++++++ .../SplFileObject_getflags_error002.phpt | 21 ++++++++++++ .../SplFileObject_haschildren_basic.phpt | 14 ++++++++ .../SplFileObject_haschildren_error001.phpt | 14 ++++++++ ext/spl/tests/SplFileObject_key_error003.phpt | 15 +++++++++ .../SplFileObject_next_variation002.phpt | 30 +++++++++++++++++ .../SplFileObject_setCsvControl_basic.phpt | 30 +++++++++++++++++ .../SplFileObject_setCsvControl_error001.phpt | 26 +++++++++++++++ .../SplFileObject_setCsvControl_error002.phpt | 26 +++++++++++++++ .../SplFileObject_setCsvControl_error003.phpt | 26 +++++++++++++++ ...FileObject_setCsvControl_variation001.phpt | 32 +++++++++++++++++++ .../fileobject_getmaxlinelen_error001.phpt | 14 ++++++++ .../fileobject_setmaxlinelen_error001.phpt | 19 +++++++++++ .../fileobject_setmaxlinelen_error002.phpt | 14 ++++++++ .../fileobject_setmaxlinelen_error003.phpt | 14 ++++++++ 16 files changed, 323 insertions(+) create mode 100644 ext/spl/tests/SplFileObject_getchildren_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_getchildren_error001.phpt create mode 100644 ext/spl/tests/SplFileObject_getflags_error002.phpt create mode 100644 ext/spl/tests/SplFileObject_haschildren_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_haschildren_error001.phpt create mode 100644 ext/spl/tests/SplFileObject_key_error003.phpt create mode 100644 ext/spl/tests/SplFileObject_next_variation002.phpt create mode 100644 ext/spl/tests/SplFileObject_setCsvControl_basic.phpt create mode 100644 ext/spl/tests/SplFileObject_setCsvControl_error001.phpt create mode 100644 ext/spl/tests/SplFileObject_setCsvControl_error002.phpt create mode 100644 ext/spl/tests/SplFileObject_setCsvControl_error003.phpt create mode 100644 ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt create mode 100644 ext/spl/tests/fileobject_getmaxlinelen_error001.phpt create mode 100644 ext/spl/tests/fileobject_setmaxlinelen_error001.phpt create mode 100644 ext/spl/tests/fileobject_setmaxlinelen_error002.phpt create mode 100644 ext/spl/tests/fileobject_setmaxlinelen_error003.phpt diff --git a/ext/spl/tests/SplFileObject_getchildren_basic.phpt b/ext/spl/tests/SplFileObject_getchildren_basic.phpt new file mode 100644 index 0000000000000..9c2a07e168253 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getchildren_basic.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: SplFileObject::getchildren basic +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +getChildren()); + +?> +--EXPECT-- +NULL diff --git a/ext/spl/tests/SplFileObject_getchildren_error001.phpt b/ext/spl/tests/SplFileObject_getchildren_error001.phpt new file mode 100644 index 0000000000000..b297fabed7fbc --- /dev/null +++ b/ext/spl/tests/SplFileObject_getchildren_error001.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: SplFileObject::getchildren error 001 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +getChildren('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::getChildren() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_getflags_error002.phpt b/ext/spl/tests/SplFileObject_getflags_error002.phpt new file mode 100644 index 0000000000000..e2c8255f44960 --- /dev/null +++ b/ext/spl/tests/SplFileObject_getflags_error002.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::getFlags error 001 +--CREDITS-- +Erwin Poeze +--FILE-- +setFlags(SplFileObject::READ_CSV); + +$fo->getFlags('fake'); + +?> +--CLEAN-- + +--EXPECTF-- +Warning: SplFileObject::getFlags() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_haschildren_basic.phpt b/ext/spl/tests/SplFileObject_haschildren_basic.phpt new file mode 100644 index 0000000000000..846f23d9c03a2 --- /dev/null +++ b/ext/spl/tests/SplFileObject_haschildren_basic.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: SplFileObject::haschildren basic +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +hasChildren()); + +?> +--EXPECT-- +bool(false) diff --git a/ext/spl/tests/SplFileObject_haschildren_error001.phpt b/ext/spl/tests/SplFileObject_haschildren_error001.phpt new file mode 100644 index 0000000000000..9b0ebc3f85f76 --- /dev/null +++ b/ext/spl/tests/SplFileObject_haschildren_error001.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: SplFileObject::haschildren error 001 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +hasChildren('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::hasChildren() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_key_error003.phpt b/ext/spl/tests/SplFileObject_key_error003.phpt new file mode 100644 index 0000000000000..7568cf55f4e40 --- /dev/null +++ b/ext/spl/tests/SplFileObject_key_error003.phpt @@ -0,0 +1,15 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Erwin Poeze +--FILE-- +key(3); +?> +--EXPECTF-- +Warning: SplFileObject::key() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_next_variation002.phpt b/ext/spl/tests/SplFileObject_next_variation002.phpt new file mode 100644 index 0000000000000..d48ff8c22371c --- /dev/null +++ b/ext/spl/tests/SplFileObject_next_variation002.phpt @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplFileObject::next variation 002, read ahead +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(2); +echo $s->current(); +$s->next(); +echo $s->current(); + +$s->setFlags(SplFileObject::READ_AHEAD); + +$s->seek(2); +echo $s->current(); +$s->next(); +echo $s->current(); +?> +--EXPECT-- +//line 3 +//line 4 +//line 3 +//line 4 diff --git a/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt b/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt new file mode 100644 index 0000000000000..b2630606e8eab --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplFileObject::setCsvControl basic +--CREDITS-- +Erwin Poeze +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', '\'', '/'); +foreach ($s as $row) { + list($fruit, $quantity) = $row; + echo "$fruit : $quantity\n"; +} +?> +--CLEAN-- + +--EXPECT-- +groene appelen : 10 +gele bananen : 20 +rode kersen : 30 + diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt new file mode 100644 index 0000000000000..7190a18b44011 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt @@ -0,0 +1,26 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 001 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('||'); +?> +--CLEAN-- + +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): delimiter must be a character in %s on line %d + diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt new file mode 100644 index 0000000000000..e3ca1fe7f7541 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt @@ -0,0 +1,26 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 002 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', 'two'); +?> +--CLEAN-- + +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): enclosure must be a character in %s on line %d + diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt new file mode 100644 index 0000000000000..8b1f54d5a42b1 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt @@ -0,0 +1,26 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 003 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', '\'', 'three'); +?> +--CLEAN-- + +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): escape must be a character in %s on line %d + diff --git a/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt b/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt new file mode 100644 index 0000000000000..e41f2ffbce939 --- /dev/null +++ b/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt @@ -0,0 +1,32 @@ +--TEST-- +SPL: SplFileObject::setCsvControl variation 001 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl(); +foreach ($s as $row) { + list($fruit, $quantity) = $row; + echo "$fruit : $quantity\n"; +} +?> +--CLEAN-- + +--EXPECT-- +groene appelen : 10 +gele bananen : 20 +rode kersen : 30 + diff --git a/ext/spl/tests/fileobject_getmaxlinelen_error001.phpt b/ext/spl/tests/fileobject_getmaxlinelen_error001.phpt new file mode 100644 index 0000000000000..3c0c9eebd52ca --- /dev/null +++ b/ext/spl/tests/fileobject_getmaxlinelen_error001.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: SplFileObject::getMaxLineLen error 001 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +getMaxLineLen('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::getMaxLineLen() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt b/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt new file mode 100644 index 0000000000000..73913692d42d4 --- /dev/null +++ b/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt @@ -0,0 +1,19 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 001() +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +setMaxLineLen(-1); +} +catch (DomainException $e) { + echo 'DomainException thrown'; +} + +?> +--EXPECT-- +DomainException thrown diff --git a/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt b/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt new file mode 100644 index 0000000000000..13e9ff133c9f1 --- /dev/null +++ b/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 002 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +setMaxLineLen(); + +?> +--EXPECTF-- +Warning: SplFileObject::setMaxLineLen() expects exactly 1 parameter, 0 given in %s on line %d diff --git a/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt b/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt new file mode 100644 index 0000000000000..6777ab6c37fda --- /dev/null +++ b/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt @@ -0,0 +1,14 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 003 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +setMaxLineLen('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::setMaxLineLen() expects parameter 1 to be long, string given in %s on line %d From f2498739403b1c8ca3567126f2a5d405da07fc51 Mon Sep 17 00:00:00 2001 From: donnut Date: Thu, 28 Jun 2012 11:13:47 +0000 Subject: [PATCH 3/4] removed unneccesary arrat and ini settings --- ext/spl/tests/SplFileObject_getchildren_basic.phpt | 2 -- ext/spl/tests/SplFileObject_getchildren_error001.phpt | 2 -- .../tests/SplFileObject_getflags_variation001.phpt | 11 ----------- ext/spl/tests/SplFileObject_haschildren_basic.phpt | 2 -- ext/spl/tests/SplFileObject_haschildren_error001.phpt | 2 -- .../tests/SplFileObject_setCsvControl_error001.phpt | 2 -- .../tests/SplFileObject_setCsvControl_error002.phpt | 2 -- .../SplFileObject_setCsvControl_variation001.phpt | 2 -- ext/spl/tests/fileobject_setmaxlinelen_error001.phpt | 2 -- ext/spl/tests/fileobject_setmaxlinelen_error002.phpt | 2 -- ext/spl/tests/fileobject_setmaxlinelen_error003.phpt | 2 -- 11 files changed, 31 deletions(-) diff --git a/ext/spl/tests/SplFileObject_getchildren_basic.phpt b/ext/spl/tests/SplFileObject_getchildren_basic.phpt index 9c2a07e168253..065e8eae45a25 100644 --- a/ext/spl/tests/SplFileObject_getchildren_basic.phpt +++ b/ext/spl/tests/SplFileObject_getchildren_basic.phpt @@ -2,8 +2,6 @@ SPL: SplFileObject::getchildren basic --CREDITS-- Erwin Poeze ---INI-- -include_path=. --FILE-- ---INI-- -include_path=. --FILE-- --FILE-- setFlags(SplFileObject::DROP_NEW_LINE); var_dump($fo->getFlags()); diff --git a/ext/spl/tests/SplFileObject_haschildren_basic.phpt b/ext/spl/tests/SplFileObject_haschildren_basic.phpt index 846f23d9c03a2..1ce00bfd42b13 100644 --- a/ext/spl/tests/SplFileObject_haschildren_basic.phpt +++ b/ext/spl/tests/SplFileObject_haschildren_basic.phpt @@ -2,8 +2,6 @@ SPL: SplFileObject::haschildren basic --CREDITS-- Erwin Poeze ---INI-- -include_path=. --FILE-- ---INI-- -include_path=. --FILE-- ---INI-- -include_path=. --FILE-- ---INI-- -include_path=. --FILE-- ---INI-- -include_path=. --FILE-- ---INI-- -include_path=. --FILE-- ---INI-- -include_path=. --FILE-- ---INI-- -include_path=. --FILE-- Date: Tue, 3 Jul 2012 15:50:31 +0000 Subject: [PATCH 4/4] new tests getAvailableDrivers --- ext/pdo/tests/PDO_getAvailableDrivers_basic.phpt | 15 +++++++++++++++ .../tests/PDO_getAvailableDrivers_error001.phpt | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 ext/pdo/tests/PDO_getAvailableDrivers_basic.phpt create mode 100644 ext/pdo/tests/PDO_getAvailableDrivers_error001.phpt diff --git a/ext/pdo/tests/PDO_getAvailableDrivers_basic.phpt b/ext/pdo/tests/PDO_getAvailableDrivers_basic.phpt new file mode 100644 index 0000000000000..fd7e2819d3341 --- /dev/null +++ b/ext/pdo/tests/PDO_getAvailableDrivers_basic.phpt @@ -0,0 +1,15 @@ +--TEST-- +PDO::getAvailableDrivers basic +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Array +( + [0] => sqlite +) diff --git a/ext/pdo/tests/PDO_getAvailableDrivers_error001.phpt b/ext/pdo/tests/PDO_getAvailableDrivers_error001.phpt new file mode 100644 index 0000000000000..77b1cddc59337 --- /dev/null +++ b/ext/pdo/tests/PDO_getAvailableDrivers_error001.phpt @@ -0,0 +1,12 @@ +--TEST-- +PDO::getAvailableDrivers error when argument supplied +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: PDO::getAvailableDrivers() expects exactly 0 parameters, 1 given in %s on line %d