Annotation of embedaddon/php/ext/bz2/tests/005.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: bzcompress()/bzdecompress() tests
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("bz2")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: $string = "Life it seems, will fade away
! 9: Drifting further everyday
! 10: Getting lost within myself
! 11: Nothing matters no one else";
! 12:
! 13: var_dump(bzcompress());
! 14: var_dump(bzcompress(1,1,1));
! 15: var_dump(bzcompress($string, 100));
! 16: var_dump(bzcompress($string, 100, -1));
! 17: var_dump(bzcompress($string, 100, 1000));
! 18: var_dump(bzcompress($string, -1, 1));
! 19:
! 20: $data = bzcompress($string);
! 21: $data2 = bzcompress($string, 1, 10);
! 22:
! 23: $data3 = $data2;
! 24: $data3{3} = 0;
! 25:
! 26: var_dump(bzdecompress());
! 27: var_dump(bzdecompress(1,1,1));
! 28: var_dump(bzdecompress(1,1));
! 29: var_dump(bzdecompress($data3));
! 30: var_dump(bzdecompress($data3,1));
! 31:
! 32: var_dump(bzdecompress($data, -1));
! 33: var_dump(bzdecompress($data, 0));
! 34: var_dump(bzdecompress($data, 1000));
! 35: var_dump(bzdecompress($data));
! 36: var_dump(bzdecompress($data2));
! 37:
! 38: echo "Done\n";
! 39: ?>
! 40: --EXPECTF--
! 41: Warning: bzcompress() expects at least 1 parameter, 0 given in %s on line %d
! 42: NULL
! 43: string(%d) "BZ%a"
! 44: int(-2)
! 45: int(-2)
! 46: int(-2)
! 47: int(-2)
! 48:
! 49: Warning: bzdecompress() expects at least 1 parameter, 0 given in %s on line %d
! 50: bool(false)
! 51:
! 52: Warning: bzdecompress() expects at most 2 parameters, 3 given in %s on line %d
! 53: bool(false)
! 54: int(-5)
! 55: int(-5)
! 56: int(-5)
! 57: bool(false)
! 58: string(110) "Life it seems, will fade away
! 59: Drifting further everyday
! 60: Getting lost within myself
! 61: Nothing matters no one else"
! 62: bool(false)
! 63: string(110) "Life it seems, will fade away
! 64: Drifting further everyday
! 65: Getting lost within myself
! 66: Nothing matters no one else"
! 67: string(110) "Life it seems, will fade away
! 68: Drifting further everyday
! 69: Getting lost within myself
! 70: Nothing matters no one else"
! 71: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>