Esempio n. 1
0
 /**
  * @covers ULogin\Init::setProviders()
  * @covers ULogin\Init::setFields()
  * @covers ULogin\Init::setOptional()
  * @covers ULogin\Init::setType()
  * @covers ULogin\Init::setUrl()
  */
 public function testSetters()
 {
     // call method
     $providers = $this->init->setProviders('vkontakte=true,odnoklassniki=true,facebook=false,google=false,yandex=true');
     $this->assertInstanceOf('ULogin\\Init', $providers, "[-] setProviders() return must be instance of ULogin\\Init");
     // call method
     $fieldsString = $this->init->setFields('first_name,last_name,photo,city');
     $this->assertInstanceOf('ULogin\\Init', $fieldsString, "[-] setFields() return must be instance of ULogin\\Init");
     $fieldsArray = $this->init->setFields(array('first_name', 'last_name', 'photo', 'city'));
     $this->assertInstanceOf('ULogin\\Init', $fieldsArray, "[-] setFields() return must be instance of ULogin\\Init");
     // call method
     $optionalArray = $this->init->setOptional(array('first_name', 'last_name', 'photo', 'city'));
     $this->assertInstanceOf('ULogin\\Init', $optionalArray, "[-] setOptional() return must be instance of ULogin\\Init");
     $optionalString = $this->init->setOptional('first_name,last_name,photo,city');
     $this->assertInstanceOf('ULogin\\Init', $optionalString, "[-] setOptional() return must be instance of ULogin\\Init");
     // call method
     $typeString = $this->init->setType('panel');
     $this->assertInstanceOf('ULogin\\Init', $typeString, "[-] setType() return must be instance of ULogin\\Init");
     $typeArray = $this->init->setType(array('panel'));
     $this->assertInstanceOf('ULogin\\Init', $typeArray, "[-] setType() return must be instance of ULogin\\Init");
     // call method
     $urlArray = $this->init->setUrl(array('?success'));
     $this->assertInstanceOf('ULogin\\Init', $urlArray, "[-] setUrl() return must be instance of ULogin\\Init");
     $urlArray = $this->init->setUrl('');
     $this->assertInstanceOf('ULogin\\Init', $urlArray, "[-] setUrl() return must be instance of ULogin\\Init");
 }