/** * [addCall 添加IO CLIENT] * @param TestClient $client [description] */ public function addCall(TestClient $client) { /** * 判断用户是否设置了key,如果没有,代为设置,按照添加顺序来设置KEY */ if (empty($client->getKey())) { $client->setKey($this->client_key); $this->client_key++; } $this->callList[] = $client; }
/** * @Test */ public function testLogoutAction() { $client = new \TestClient('test', 'test'); $authClient = $client->auth(); $link = $authClient->getCrawler()->filter('a[href="/logout"]')->link(); $authClient->click($link); $authClient->followRedirect(); $authClient->followRedirect(); // Logout makes 2 redirects $crawler = $authClient->getCrawler(); $this->assertSame('Login Form', trim($crawler->filter('h1')->text())); $client->logout(); }
/** * @depends testGetProviderById */ public function testCreateProvider() { $collection = new Collection(); $clientId = 'testClientId'; $clientClassName = TestClient::className(); $clients = [$clientId => ['class' => $clientClassName]]; $collection->setClients($clients); $provider = $collection->getClient($clientId); $this->assertTrue(is_object($provider), 'Unable to create client by config!'); $this->assertTrue(is_a($provider, $clientClassName), 'Client has wrong class name!'); }
public function injectModel($data, \TestClient $client) { \Tracy\Debugger::bardump($data); \Tracy\Debugger::bardump($client->doDummy()); }
public function logout() { self::$client->request('GET', '/logout'); self::$client->followRedirect(); self::$client = null; }