public function testNotExists() { $arrayAccess = $this->getArrayAccessor(); $this->tester->assertExceptionThrown('WebChemistry\\Parameters\\ParameterNotExistsException', function () use($arrayAccess) { $arrayAccess['notExists']->asd = NULL; }); }
public function testCreateWithoutFactory() { $factory = new \WebChemistry\Forms\Factory\Container(); $this->tester->assertExceptionThrown('WebChemistry\\Forms\\FormException', function () use($factory) { $factory->create(); }); }
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'); }); }
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()); }
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(); }); }
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'); }); }