Example #1
0
 /**
  * Run a test and track its results.
  *
  * @param TestInterface $test
  * @param TestResult $result
  */
 protected function runTest(TestInterface $test, TestResult $result)
 {
     if ($this->getPending() !== null) {
         $test->setPending($this->getPending());
     }
     $test->setEventEmitter($this->eventEmitter);
     $test->run($result);
 }
Example #2
0
 /**
  * Add a test to the suite
  *
  * @param Test $test
  */
 public function addTest(TestInterface $test)
 {
     $test->setParent($this);
     $this->tests[] = $test;
 }
Example #3
0
 /**
  * {@inheritdoc}
  *
  * @param  TestInterface $parent
  * @return mixed|void
  */
 public function setParent(TestInterface $parent)
 {
     $this->parent = $parent;
     $this->setScope($parent->getScope());
 }
Example #4
0
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
/* Test the authenticator stuff.  */
require_once "../lib/config.inc.php";
require_once "../libauth/authenticator.inc.php";
require_once "../libauth/namecoin_interface.inc.php";
require_once "../libauth/namecoin_rpc.inc.php";
$rpc = new HttpNamecoin($rpcHost, $rpcPort, $rpcUser, $rpcPassword);
$nc = new TestInterface($rpc, $namePrefix);
$serverURI = "http://localhost/";
$nonce = "nonce";
$auth = new Authenticator($nc, $serverURI);
/* In order to be independent with this test from changes to the names
   themselves, use manufactured values instead of those from real Namecoin.
   For simplicity, we always use the same name and use different values
   for it, for which different addresses should be able to sign in.  */
$name = "tester";
$msg = "login {$serverURI}?name={$name} {$nonce}";
$addrOwner = "NBLR56K5MLaj4UANhnFxVd3YojGLMJtLMz";
$addrSigner = "N7kHj9NTJEhfAe8hqEgdtzgoFesPiTGCKG";
$addrOther = "NFC6fwbcjAsyacKBg96awSGMw9xc8MfqmF";
$sigOwner = "G9V1eShLLJr31kLgI8zOAs5mjy3/08k1ZlKzvOZKcouJzmUJNWa8wdtMZ" . "+KFqEYb3TGuHNkMx5AZF9posLgailg=";
$sigSigner = "G1za+rWNCt19mLCQ5IRc4FMykg5qxbsooc0Ke+h89KAtfrhfEdWOXUCD" . "HCIdmdVxRBf9wRdhbPeHrkZ7o/K4GaY=";
$sigOther = "G08xOpzdKuxHSATuA7u3Zf/ueERY1yUc+mB5jkxK/oaZQnkvsmvVmvljE" . "nQSPyKpn1QOHkcBoeRdxSsOx5WwFHg=";