Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaidas Bagdonas committed Dec 10, 2019
1 parent 7f6dd69 commit 3576e66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion tests/Phpforce/SoapClient/Tests/BulkSaverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public function testDeleteWithoutIdThrowsException()
$client = $this->getClient();
$bulkSaver = new BulkSaver($client);
$invalidRecord = new \stdClass();
$this->setExpectedException('\InvalidArgumentException', 'Only records with an Id can be deleted');
$this->expectException('\InvalidArgumentException');
$this->expectExceptionMessage('Only records with an Id can be deleted');
$bulkSaver->delete($invalidRecord);
}

Expand Down
9 changes: 5 additions & 4 deletions tests/Phpforce/SoapClient/Tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testInvalidQueryThrowsSoapFault()

$client = $this->getClient($soapClient);

$this->setExpectedException('\SoapFault');
$this->expectException('\SoapFault');
$client->query('Select NonExistingField from Account');
}

Expand All @@ -96,7 +96,7 @@ public function testInvalidUpdateResultsInError()
->method('update')
->will($this->returnValue($result));

$this->setExpectedException('\Phpforce\SoapClient\Exception\SaveException');
$this->expectException('\Phpforce\SoapClient\Exception\SaveException');
$this->getClient($soapClient)->update(array(
(object) array(
'Id' => 'invalid-id',
Expand All @@ -108,7 +108,8 @@ public function testInvalidUpdateResultsInError()
public function testMergeMustThrowException()
{
$soapClient= $this->getSoapClient(array('merge'));
$this->setExpectedException('\InvalidArgumentException', 'must be an instance of');
$this->expectException('\InvalidArgumentException');
$this->expectExceptionMessage('must be an instance of');
$this->getClient($soapClient)->merge(array(new \stdClass), 'Account');
}

Expand Down Expand Up @@ -192,7 +193,7 @@ public function testWithEventDispatcher()
// ->method('dispatch')
// ->with('php_force.soap_client.error');

$this->setExpectedException('\Phpforce\SoapClient\Exception\SaveException');
$this->expectException('\Phpforce\SoapClient\Exception\SaveException');

$client->setEventDispatcher($dispatcher);
$client->create(array($c), 'Contact');
Expand Down

0 comments on commit 3576e66

Please sign in to comment.