function isAllowed($assoc_type, $session_type) { $assoc_good = in_array(array($assoc_type, $session_type), $this->allowed_types); $matches = in_array($session_type, Auth_OpenID_getSessionTypes($assoc_type)); return $assoc_good && $matches; }
function testAddAllowedTypeContents() { $assoc_type = 'HMAC-SHA1'; $this->assertTrue($this->n->addAllowedType($assoc_type)); foreach (Auth_OpenID_getSessionTypes($assoc_type) as $typ) { $this->assertTrue(in_array(array($assoc_type, $typ), $this->n->allowed_types)); } }