Skip to content

Commit

Permalink
Adds support for Containers
Browse files Browse the repository at this point in the history
  • Loading branch information
darrynten committed Oct 30, 2019
1 parent 891458f commit ed41db0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Concerns/InteractsWithContainer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace AlbertCht\Lumen\Testing\Concerns;

trait InteractsWithContainer
{
/**
* Register an instance of an object in the container.
*
* @param string $abstract
* @param object $instance
* @return object
*/
protected function swap($abstract, $instance)
{
return $this->instance($abstract, $instance);
}
/**
* Register an instance of an object in the container.
*
* @param string $abstract
* @param object $instance
* @return object
*/
protected function instance($abstract, $instance)
{
$this->app->instance($abstract, $instance);
return $instance;
}
}

0 comments on commit ed41db0

Please sign in to comment.