/** * Test createClassifier failed auth is handled appropriately * * @expectedException \Bobbyshaw\WatsonVisualRecognition\Exceptions\AuthException */ public function testCreateClassifierFailedAuthResponse() { $container = []; $response = $this->getMockHttpResponse('FailedAuth.txt', 401); $httpClient = $this->getMockHttpClientWithHistoryAndResponses($container, [$response]); $client = new Client($httpClient); $client->initialize(['username' => 'test', 'password' => 'test']); /** @var CreateClassifierRequest $request */ $request = $client->createClassifier($this->request->getData()); $request->send(); }
/** * Check for expected image and classifier IDs */ public function testGetData() { $data = $this->request->getData(); $this->assertSame('Tests/images/hummingbird-1047836_640.jpg', $data['images_file']); $this->assertSame([1, 2, 3], $data['classifier_ids']); }