src/LaravelTrait.php
public function assertIsInjectable(string $name)
    {
        $injectable = true;

        $message = "The class '$name' couldn't be automatically injected.";

        try {
            $class = $this->makeInjectableClass($name);
            $this->assertInstanceOf($name, $class->getInjectedObject());
        } catch (Exception $e) {
            $injectable = false;
            if ($msg = $e->getMessage()) {
                $message .= " $msg";
            }
        }

        $this->assertTrue($injectable, $message);
    }
public function assertIsInjectable(string $name)
    {
        $injectable = true;

        $message = "The class '$name' couldn't be automatically injected.";

        try {
            $class = $this->makeInjectableClass($name);
            $this->assertInstanceOf($name, $class->getInjectedObject());
        } catch (Exception $e) {
            $injectable = false;
            if ($msg = $e->getMessage()) {
                $message .= " $msg";
            }
        }

        $this->assertTrue($injectable, $message);
    }
public function assertIsInjectable ( string $ name ) { $ injectable = true ; $ message = "The class '$name' couldn't be automatically injected." ; try { $ class = $ this -> makeInjectableClass ( $ name ) ; $ this -> assertInstanceOf ( $ name , $ class -> getInjectedObject ( ) ) ; } catch ( Exception $ e ) { $ injectable = false ; if ( $ msg = $ e -> getMessage ( ) ) { $ message .= " $msg" ; } } $ this -> assertTrue ( $ injectable , $ message ) ; }
Assert that a class can be automatically injected.

@param string $name

@return void
Assert that a class can be automatically injected .