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


PHP UnitTester::assertExceptionThrown方法代码示例

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


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

示例1: testNotExists

 public function testNotExists()
 {
     $arrayAccess = $this->getArrayAccessor();
     $this->tester->assertExceptionThrown('WebChemistry\\Parameters\\ParameterNotExistsException', function () use($arrayAccess) {
         $arrayAccess['notExists']->asd = NULL;
     });
 }
开发者ID:webchemistry,项目名称:parameters,代码行数:7,代码来源:ArrayAccessorTest.php

示例2: testCreateWithoutFactory

 public function testCreateWithoutFactory()
 {
     $factory = new \WebChemistry\Forms\Factory\Container();
     $this->tester->assertExceptionThrown('WebChemistry\\Forms\\FormException', function () use($factory) {
         $factory->create();
     });
 }
开发者ID:webchemistry,项目名称:forms,代码行数:7,代码来源:ContainerTest.php

示例3: testForm

 public function testForm()
 {
     $ctrl = $this->ctrl;
     $this->assertInstanceOf('WebChemistry\\Forms\\Form', $this->ctrl->createMyForm());
     $this->tester->assertExceptionThrown('Nette\\InvalidStateException', function () use($ctrl) {
         $ctrl->getPresenter();
     });
     $this->tester->assertExceptionThrown('Nette\\InvalidStateException', function () use($ctrl) {
         $ctrl->flashMessage('flash');
     });
 }
开发者ID:webchemistry,项目名称:forms,代码行数:11,代码来源:ControlTest.php

示例4: testPrice

 public function testPrice()
 {
     $this->tester->assertExceptionThrown('WebChemistry\\ThePay\\InvalidArgumentException', function () {
         $this->thePay->createSender('test');
     });
     $this->tester->assertExceptionThrown('WebChemistry\\ThePay\\InvalidArgumentException', function () {
         $this->thePay->createSender(['test']);
     });
     $this->assertSame(400.0, $this->thePay->createSender(400)->getValue());
     $this->assertSame(400.0, $this->thePay->createSender('400')->getValue());
 }
开发者ID:webchemistry,项目名称:thepay,代码行数:11,代码来源:SenderTest.php

示例5: testPrice

 public function testPrice()
 {
     $receiver = $this->getReceiver(['value' => 'string']);
     $this->assertFalse($receiver->verifySignature(FALSE));
     $this->tester->assertExceptionThrown(\WebChemistry\ThePay\ThePayException::class, function () use($receiver) {
         $receiver->verifySignature();
     });
 }
开发者ID:webchemistry,项目名称:thepay,代码行数:8,代码来源:ReceiverTest.php

示例6: testResetEventsArray

 public function testResetEventsArray()
 {
     $form = new Form();
     $form->onSuccess[] = function () {
     };
     $form->onSuccess[] = function () {
     };
     $form->onSubmit[] = function () {
     };
     $form->onError[] = function () {
     };
     $form->onError[] = function () {
     };
     $form->resetEvents(['onSuccess', 'onSubmit']);
     $this->assertSame(array(), $form->onSuccess);
     $this->assertSame(array(), $form->onSubmit);
     $this->assertCount(2, $form->onError);
     $this->tester->assertExceptionThrown('Nette\\InvalidArgumentException', function () use($form) {
         $form->resetEvents('onNotExists');
     });
 }
开发者ID:webchemistry,项目名称:forms,代码行数:21,代码来源:FormTest.php


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