Welcome Guest, Not a member yet? Register   Sign In
Unit testing problem
#1

Hi all.

I'm working on some very simple unit testing with CI4 and am running into an issue. I'm trying to use the call() method as described in the 'Requesting a Page' section here: https://codeigniter4.github.io/userguide...ature.html.

My code:
PHP Code:
<?php
namespace App;

use 
CodeIgniter\Test\FeatureTestCase;

class 
RoutesTest extends FeatureTestCase{
  /**
   * @runInSeparateProcess
   * @preserveGlobalState disabled
   */
  function testGetClassesList(){
    $result $this->call('get''https://mytestapp.com:8001/classes');
    $this->assertTrue($result->isOK());
  }


And the results are this:
Code:
1) App\RoutesTest::testGetClassesList()
ErrorException: Trying to get property 'database_name' of non-object

Anybody have any ideas?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB