当前位置: 首页>>代码示例>>PHP>>正文


PHP helper::getPasteId方法代码示例

本文整理汇总了PHP中helper::getPasteId方法的典型用法代码示例。如果您正苦于以下问题:PHP helper::getPasteId方法的具体用法?PHP helper::getPasteId怎么用?PHP helper::getPasteId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在helper的用法示例。


在下文中一共展示了helper::getPasteId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testFileBasedAttachmentStoreWorks

 public function testFileBasedAttachmentStoreWorks()
 {
     $this->_model->delete(helper::getPasteId());
     $original = $paste = helper::getPasteWithAttachment(array('expire_date' => 1344803344));
     $paste['meta']['attachment'] = $paste['attachment'];
     $paste['meta']['attachmentname'] = $paste['attachmentname'];
     unset($paste['attachment'], $paste['attachmentname']);
     $this->assertFalse($this->_model->exists(helper::getPasteId()), 'paste does not yet exist');
     $this->assertTrue($this->_model->create(helper::getPasteId(), $paste), 'store new paste');
     $this->assertTrue($this->_model->exists(helper::getPasteId()), 'paste exists after storing it');
     $this->assertFalse($this->_model->create(helper::getPasteId(), $paste), 'unable to store the same paste twice');
     $this->assertEquals(json_decode(json_encode($original)), $this->_model->read(helper::getPasteId()));
 }
开发者ID:danesjenovdan,项目名称:DJNBin,代码行数:13,代码来源:data.php

示例2: testCommentDeletion

 /**
  * @expectedException Exception
  * @expectedExceptionCode 64
  */
 public function testCommentDeletion()
 {
     $pasteData = helper::getPaste();
     $this->_model->getPaste(helper::getPasteId())->delete();
     $paste = $this->_model->getPaste();
     $paste->setData($pasteData['data']);
     $paste->store();
     $paste->getComment(helper::getPasteId())->delete();
 }
开发者ID:danesjenovdan,项目名称:DJNBin,代码行数:13,代码来源:model.php

示例3: testDeleteExpired

 /**
  * @runInSeparateProcess
  */
 public function testDeleteExpired()
 {
     $this->reset();
     $expiredPaste = helper::getPaste(array('expire_date' => 1000));
     $this->assertFalse($this->_model->exists(helper::getPasteId()), 'paste does not exist before being created');
     $this->_model->create(helper::getPasteId(), $expiredPaste);
     $this->assertTrue($this->_model->exists(helper::getPasteId()), 'paste exists before deleting data');
     $_GET['pasteid'] = helper::getPasteId();
     $_GET['deletetoken'] = 'does not matter in this context, but has to be set';
     ob_start();
     new zerobin();
     $content = ob_get_contents();
     $this->assertTag(array('id' => 'errormessage', 'content' => 'Paste does not exist'), $content, 'outputs error correctly');
     $this->assertFalse($this->_model->exists(helper::getPasteId()), 'paste successfully deleted');
 }
开发者ID:danesjenovdan,项目名称:DJNBin,代码行数:18,代码来源:zerobin.php

示例4: testJsonLdInvalid

 /**
  * @runInSeparateProcess
  */
 public function testJsonLdInvalid()
 {
     $this->reset();
     $paste = helper::getPasteWithAttachment();
     $this->_model->create(helper::getPasteId(), $paste);
     $_GET['jsonld'] = '../cfg/conf.ini';
     ob_start();
     new zerobin();
     $content = ob_get_contents();
     $this->assertEquals('{}', $content, 'does not output nasty data');
 }
开发者ID:danesjenovdan,项目名称:DJNBin,代码行数:14,代码来源:jsonApi.php


注:本文中的helper::getPasteId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。