Skip to content

Commit

Permalink
add requisite autoloader fix loading tests #48
Browse files Browse the repository at this point in the history
  • Loading branch information
derpixler committed Apr 4, 2016
1 parent 22ed216 commit 070f408
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?php # -*- coding: utf-8 -*-
namespace Inpsyde\SearchReplace;

$base_dir = dirname( __DIR__ );
/**
* Load the Requisite library. Alternatively you can use composer's
*/
require_once 'inc/requisite/src/Requisite/Requisite.php';
\Requisite\Requisite::init();

$composer_file = $base_dir . '/vendor/autoload.php';

if ( file_exists( $composer_file ) ) {
require_once $composer_file;
}
$autoloader = new \Requisite\SPLAutoLoader;
$autoloader->addRule(
new \Requisite\Rule\Psr4(
__DIR__ . '/../inc', // base directory
'Inpsyde\SearchReplace' // base namespace
)
);

0 comments on commit 070f408

Please sign in to comment.