yii\authclient\Collection::hasClient PHP Метод

hasClient() публичный Метод

Checks if client exists in the hub.
public hasClient ( string $id ) : boolean
$id string client id.
Результат boolean whether client exist.
    public function hasClient($id)
    {
        return array_key_exists($id, $this->_clients);
    }

Usage Example

 /**
  * @depends testSetGet
  */
 public function testHasProvider()
 {
     $collection = new Collection();
     $clientName = 'testClientName';
     $clients = [$clientName => ['class' => 'TestClient1']];
     $collection->setClients($clients);
     $this->assertTrue($collection->hasClient($clientName), 'Existing client check fails!');
     $this->assertFalse($collection->hasClient('unExistingClientName'), 'Not existing client check fails!');
 }