Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/sxzz/homebrew-brew.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364class ComposerAT1 < Formula desc "Dependency Manager for PHP" homepage "https://getcomposer.org/" url "https://getcomposer.org/download/1.10.23/composer.phar" sha256 "2fc3ae370a979602a3bc2c950a38db02e51b4ca2072f7b8e15a518b443b835e7" license "MIT"
livecheck do url "https://github.com/composer/composer.git" regex(/^[\d.]+$/i) end
def install bin.install "composer.phar" => "composer" end
test do (testpath/"composer.json").write <<~EOS { "name": "homebrew/test", "authors": [ { "name": "Homebrew" } ], "require": { "php": ">=5.3.4" }, "autoload": { "psr-0": { "HelloWorld": "src/" } } } EOS
(testpath/"src/HelloWorld/greetings.php").write <<~EOS <?php
namespace HelloWorld;
class Greetings { public static function sayHelloWorld() { return 'HelloHomebrew'; } } EOS
(testpath/"tests/test.php").write <<~EOS <?php
// Autoload files using the Composer autoloader. require_once __DIR__ . '/../vendor/autoload.php';
use HelloWorld\\Greetings;
echo Greetings::sayHelloWorld(); EOS
system "#{bin}/composer", "install" assert_match /^HelloHomebrew$/, shell_output("php tests/test.php") endend