Added Interface and Mock classes, Unit Test
This takes advantage of the interfaces to put into place a mock and a soap implementation and unit tests for Product and ProductService
Please review: @ahoffmann @npblair @weizhong-wang
Merge request reports
Activity
Added 6 commits:
-
0d132e3b...066eab32 - 4 commits from branch
adi-ia:master
- 8d3217e7 - Added Interface and Mock classes, Unit Test
- 61fedbd1 - Renamed classes to prevent future merge conflicts
-
0d132e3b...066eab32 - 4 commits from branch
Added 1 commit:
- cb405194 - Mock Testing with fix for constructors, general code reformatting
13 private $doitSoaItemService; 14 15 /** 16 * SoapTechstoreClient constructor. 17 * @param $username 18 * @param $password 19 * @internal param DOIT_SOA_ITEM_Service $doitSoaItemService 20 */ 21 public function __construct($username, $password) 22 { 23 $serviceFactory = new DOIT_SOA_ITEM_ServiceFactory(); 24 $this->doitSoaItemService = $serviceFactory->getInstance($username, $password); 25 } 26 27 28 /** - src/test/MockTechstoreUnitTest.php 0 → 100755
14 { 15 $product = new Product("4229", "Test Mouse", "Test mouse used for clicking", "19.95"); 16 17 $client = new MockTechstoreCbsClient(); 18 $result = $client->createProduct($product); 19 20 21 $this->assertInstanceOf(Product::class, $result); 22 $this->assertTrue($result->getItemNumber() == "4229"); 23 $this->assertTrue($result->getName() == "Test Mouse"); 24 $this->assertTrue($result->getCost() == "19.95"); 25 $this->assertTrue($result->getDescription() == "Test mouse used for clicking"); 26 } 27 28 /** 29 * @expectedException edu\wisc\services\cbs\MockCbsClientException Added 1 commit:
- b031ff6b - Correct Phpdoc formatting and Type Hinting
mentioned in commit 617a3419
Please register or sign in to reply