public function testWhat() { $helloWorld = new HelloWorld($this->pdo); $this->assertFalse($helloWorld->what()); $helloWorld->hello('Bar'); $this->assertEquals('Bar', $helloWorld->what()); }
<?php /** * Autoload provided by Composer */ require_once realpath(__DIR__ . '/vendor/autoload.php'); /** * Example Classes */ include realpath(__DIR__ . '/HelloWorldClasses.php'); // Use facade as Alias $aliases = ["HelloWorld" => "HelloWorldFacade"]; // Create aliases foreach ($aliases as $alias => $abstract) { class_alias($abstract, $alias); } /** * How to use a Facade Class? */ // Use normal methods HelloWorld::hello(); // You can pass arguments too. HelloWorld::hello("John Doe");
<?php namespace Scrutinizer\Docs; class HelloWorld { function hello($x) { print "Hello, {$x}"; } } $c = new HelloWorld(); $c->hello("world");
public function testHello() { $helloWorld = new HelloWorld($this->pdo); $this->assertEquals('Hello Bar', $helloWorld->hello('Bar')); }
<?php $hello = new HelloWorld(); $hello->hello(); $hello->create_tab(); /** This is my first file */ class HelloWorld { function __construct() { } function create_tab() { } function hello() { die(__METHOD__); // something is bad here. } /** * Create account for corvin. * @param type $username */ function create_account($username = "******") { echo "created account for {$username}"; } /** * Related to issue MFP-8 Administration console. */ function create_console()