5 Star 5 Fork 3

qzfzz/php-beanstalk

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
peek.phpt 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
qzfzz 提交于 2016-05-18 17:17 +08:00 . add some test and fix some bugs
--TEST--
test for beanstalk peek peekReady
--SKIPIF--
<?php if (!extension_loaded("beanstalk")) print "skip"; ?>
--FILE--
<?php
$arrConfig = include __DIR__ . '/../include/config.inc';
$b = beanstalk_connect( $arrConfig['host'], $arrConfig['port'] );
//op
$lJobID = beanstalk_put( $b, "message" );
$strPeek = var_export( beanstalk_peek( $b, $lJobID ), true );
var_dump( preg_match( "/array/", $strPeek ));
$strPeek = var_export( beanstalk_peekReady( $b ), true );
var_dump( preg_match( "/array/", $strPeek ));
beanstalk_delete( $b, $lJobID );
//beanstalk_close( $b );
//oo
$lJobID = $b->put( "message" );
$strPeek = var_export( $b->peek( $lJobID ), true );
var_dump( preg_match( "/array/", $strPeek ));
$strPeek = var_export( $b->peekReady(), true );
var_dump( preg_match( "/array/", $strPeek ));
beanstalk_delete( $b, $lJobID );
beanstalk_close( $b );
/*
you can add regression tests for your extension here
the output of your test code has to be equal to the
text in the --EXPECT-- section below for the tests
to pass, differences between the output and the
expected text are interpreted as failure
see php5/README.TESTING for further information on
writing regression tests
done resource(%d) of type (stream)
*/
?>
--EXPECTF--
int(1)
int(1)
int(1)
int(1)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/qzfzz/php-beanstalk.git
git@gitee.com:qzfzz/php-beanstalk.git
qzfzz
php-beanstalk
php-beanstalk
master

搜索帮助