/**
  * @inheritdoc
  */
 protected function tearDown()
 {
     $this->mockSocket = null;
     $this->mockFactory = null;
     m::close();
     parent::tearDown();
 }
 public function tearDown()
 {
     if ($this->db) {
         $this->db->drop();
     }
     m::close();
 }
Exemple #3
0
 public function tearDown()
 {
     unset($data);
     unset($model);
     Mockery::close();
     Artisan::call('migrate:rollback');
 }
 /**
  * Remove all mock objects
  */
 public function tearDown()
 {
     unset($this->userManager);
     unset($this->authenticationManager);
     unset($this->commandTester);
     m::close();
 }
 public function tearDown()
 {
     parent::tearDown();
     $this->allowMockingNonExistentMethods(true);
     // Verify Mockery expectations.
     Mock::close();
 }
Exemple #6
0
 /**
  * Tear down test env
  *
  * @return void
  * @author Dan Cox
  */
 public function tearDown()
 {
     m::close();
     if (!is_null($this->DI)) {
         $this->DI->clearMocks();
     }
 }
 public function tearDown()
 {
     parent::tearDown();
     m::close();
     (new \UsersCreateTable())->down();
     Facades\Schema::drop('password_reminders');
 }
 public function teardown()
 {
     m::close();
     if ($this->useDatabase) {
         $this->teardownDb();
     }
 }
Exemple #9
0
 public function tearDown()
 {
     exec('rm -rf ' . __DIR__ . '/output');
     mkdir(__DIR__ . '/output');
     touch(__DIR__ . '/output/.gitkeep');
     Mockery::close();
 }
 public function tearDown()
 {
     parent::tearDown();
     Mockery::close();
     Test::clean();
     $this->dropDatabase();
 }
 public function tearDown()
 {
     unset($this->mockFileSystem);
     unset($this->iliosFileSystem);
     unset($this->fakeTestFileDir);
     m::close();
 }
Exemple #12
0
 /**
  * Runs the example
  * 
  * @param \PHPSpec\Runner\Reporter $reporter
  */
 public function run(Reporter $reporter)
 {
     try {
         $methodName = $this->_methodName;
         $startTime = microtime(true);
         call_user_func(array($this->_exampleGroup, 'before'));
         call_user_func(array($this->_exampleGroup, $methodName));
         call_user_func(array($this->_exampleGroup, 'after'));
         $endTime = microtime(true);
         $this->_executionTime = $endTime - $startTime;
         if (class_exists('Mockery')) {
             \Mockery::close();
         }
     } catch (Failure $failure) {
         $reporter->addFailure($this, $failure);
         return;
     } catch (Pending $pending) {
         $reporter->addPending($this, $pending);
         return;
     } catch (Error $error) {
         $reporter->addError($this, $error);
         return;
     } catch (\Exception $e) {
         $reporter->addException($this, new Exception($e));
         return;
     }
     $reporter->addPass($this);
 }
 /**
  * @test
  */
 public function canApplyInflections()
 {
     // Mocking argument resolver dependency.
     $resolver = Mockery::mock(ArgumentResolver::class);
     // Callback to be returned by ArgumentResolver::resolveArguments() method.
     // Expects $arguments array to contain 'value' key to merge.
     // Will return array of arguments for TestClass::setValue() method call.
     $callback = function (array $arguments) {
         return array_values(array_merge(['value' => 'to be replaced'], $arguments));
     };
     // Reflecting method to call on inflection.
     $reflection = new ReflectionMethod(TestClass::class, 'setValue');
     // Defining expectations.
     $resolver->shouldReceive('reflectCallable')->with([TestClass::class, 'setValue'])->andReturn($reflection)->once();
     $resolver->shouldReceive('resolveArguments')->with($reflection)->andReturn($callback)->once();
     // Creating inflector, setting resolver, adding inflection.
     $inflector = new ObjectInflector($resolver);
     $inflector->addInflection(TestClass::class, 'setValue', ['value' => 'value']);
     // Creating test object.
     $test = new TestClass(new stdClass());
     // At first value is empty.
     $this->assertNull($test->getValue());
     // Applying inflections.
     $inflector->applyInflections($test);
     // Now value was changed via TestClass::setValue() call.
     $this->assertSame('value', $test->getValue());
     // After first run inflection callable must be saved for better performance.
     $test2 = new TestClass(new stdClass());
     $inflector->applyInflections($test2);
     $this->assertSame($test->getValue(), $test2->getValue());
     // Inflection must be called only on TestClass instances.
     $inflector->applyInflections(Mockery::mock(stdClass::class)->shouldNotReceive('setValue')->getMock());
     Mockery::close();
 }
 protected function tearDown()
 {
     \Mockery::close();
     $this->obj = null;
     $this->atts = null;
     $this->q = null;
 }
Exemple #15
0
 protected function _after()
 {
     m::close();
     if (isset($this->model)) {
         unset($this->model);
     }
 }
 /**
  * @inheritdoc
  */
 public function tearDown()
 {
     unset($this->service);
     unset($this->reportManager);
     unset($this->commandTester);
     m::close();
 }
Exemple #17
0
 public function tearDown()
 {
     $this->dependant_service = null;
     $this->marshaller = null;
     $this->request = null;
     m::close();
 }
 /**
  * This method is called after a test is executed.
  */
 public function tearDown()
 {
     \Mockery::close();
     $this->logger = null;
     $this->futureFunc = null;
     $this->response = null;
 }
Exemple #19
0
 public function tearDown()
 {
     Mockery::close();
     //$this->truncateTablesDb();
     Artisan::call('migrate:reset');
     parent::tearDown();
 }
 public function tearDown()
 {
     if (file_exists(sys_get_temp_dir() . '/mutagenesis.xml')) {
         unlink(sys_get_temp_dir() . '/mutagenesis.xml');
     }
     m::close();
 }
 /**
  * {@inheritdoc}
  */
 public function tearDown()
 {
     unset($this->offeringManager);
     unset($this->alertManager);
     unset($this->auditLogManager);
     m::close();
 }
Exemple #22
0
 public function tearDown()
 {
     m::close();
     _stubProduct::$connection = null;
     _stubProductPersisted::$connection = null;
     _stubCategory::$connection = null;
 }
 public function tearDown()
 {
     \Mockery::close();
     foreach (glob($this->cachedDir . '/*.php*') as $filename) {
         unlink($filename);
     }
 }
 public function tearDown()
 {
     // Call parent teardown
     parent::tearDown();
     // Close mockery
     m::close();
 }
Exemple #25
0
 public function tearDown()
 {
     if ($container = m::getContainer()) {
         $this->addToAssertionCount($container->mockery_getExpectationCount());
     }
     m::close();
     parent::tearDown();
 }
 public function testItCanDisplayTripleWithMockObject()
 {
     $spyDisplay = \Mockery::mock('Display');
     $mathLib = new MathematicalLibrary(new Calculator(), $spyDisplay);
     $spyDisplay->shouldReceive('show')->once()->with(9);
     $mathLib->displayTriple(3);
     \Mockery::close();
 }
Exemple #27
0
 public function tearDown()
 {
     $this->google_client_id = null;
     $this->google_client_secret = null;
     $this->google_client = null;
     $this->id_token = null;
     m::close();
 }
 public function tearDown()
 {
     m::close();
     // The mockWebApplication is called after a mock has been already set to the container
     // So we need to manually clear that.
     Yii::$container->clear(AlgoliaFactory::class);
     parent::tearDown();
 }
Exemple #29
0
 /**
  * tearDown method.
  */
 public function tearDown()
 {
     $this->db->query("DELETE FROM users");
     $this->db->query("DELETE FROM roles");
     $this->db->query("DELETE FROM games");
     $this->fixture->setFixtures(array());
     m::close();
 }
 public function tearDown()
 {
     unset($this->mockFileSystem);
     unset($this->iliosFileSystem);
     m::close();
     $fs = new SymfonyFileSystem();
     $fs->remove($this->fakeTestFileDir);
 }