#!/bin/sh

set -e
. ./testsuite/common.sh

composerpkg='testsuite/data/composerpkg1'

old_dir="${PWD}"
cd "$composerpkg"

expect_equal "${old_dir}/bin/phpabtpl composer.json" "<?php

// Require
require_once '/usr/share/php/Proj1/Pack2/autoload.php';
require_once '/usr/share/php/ProjOne/PackOne/autoload.php';

// Suggest

// @codingStandardsIgnoreFile
// @codeCoverageIgnoreStart
// this is an autogenerated file - do not edit
spl_autoload_register(
    function(\$class) {
        static \$classes = null;
        if (\$classes === null) {
            \$classes = array(
                ___CLASSLIST___
            );
        }
        \$cn = strtolower(\$class);
        if (isset(\$classes[\$cn])) {
            require ___BASEDIR___\$classes[\$cn];
        }
    },
    ___EXCEPTION___,
    ___PREPEND___
);
// @codeCoverageIgnoreEnd

// Files
require_once __DIR__.'/src/Vendor/Project/helpers.php';"
