Skip to content

Commit

Permalink
fix(rest): Slim fixes for REST API
Browse files Browse the repository at this point in the history
Make changes required for Slim framework v4.

Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
  • Loading branch information
GMishx committed Nov 3, 2021
1 parent 0a5c9e6 commit 9aafaf6
Show file tree
Hide file tree
Showing 95 changed files with 590 additions and 384 deletions.
4 changes: 2 additions & 2 deletions src/cli/tests/test_cp2foss.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function setUpBeforeClass()


// this method is run once before each test method defined for this test class.
protected function setUp()
protected function setUp() : void
{

fwrite(STDOUT, "--> Running " . __METHOD__ . " method.\n");
Expand Down Expand Up @@ -418,7 +418,7 @@ function test_list_agent_and_others()
* \brief clean the env
*/
// this method is run once after each test method defined for this test class.
protected function tearDown()
protected function tearDown() : void
{

global $fossology_testconfig;
Expand Down
4 changes: 2 additions & 2 deletions src/cli/tests/test_fo_copyright_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class test_fo_copyright_list extends \PHPUnit\Framework\TestCase
/** @var TestInstaller */
private $testInstaller;

protected function setUp()
protected function setUp() : void
{
$this->testDb = new TestPgDb("fossclitest");
$tables = array('users','upload','uploadtree_a','uploadtree','copyright','groups','group_user_member','agent','copyright_decision','copyright_ars','ars_master','copyright_event');
Expand All @@ -45,7 +45,7 @@ protected function setUp()
$this->testInstaller->init();
}

protected function tearDown()
protected function tearDown() : void
{
return;
$this->testInstaller->clear();
Expand Down
4 changes: 2 additions & 2 deletions src/cli/tests/test_fo_nomos_license_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static function setUpBeforeClass()


// this method is run once before each test method defined for this test class.
protected function setUp()
protected function setUp() : void
{

fwrite(STDOUT, "--> Running " . __METHOD__ . " method.\n");
Expand Down Expand Up @@ -245,7 +245,7 @@ function test_others()
* \brief clean the env
*/
// this method is run once after each test method defined for this test class.
protected function tearDown()
protected function tearDown() : void
{

global $fossology_testconfig;
Expand Down
4 changes: 2 additions & 2 deletions src/cli/tests/test_fossjobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function setUpBeforeClass()
}

/* initialization */
protected function setUp()
protected function setUp() : void
{

fwrite(STDOUT, "--> Running " . __METHOD__ . " method.\n");
Expand Down Expand Up @@ -253,7 +253,7 @@ function test_list_agent_and_others()
/**
* \brief clean the env
*/
protected function tearDown()
protected function tearDown() : void
{
global $fossology_testconfig;

Expand Down
1 change: 1 addition & 0 deletions src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"monolog/monolog" : "2.3.4",
"phpoffice/phpword" : "0.18.2",
"slim/slim": "4.8.1",
"slim/psr7": "1.4",
"symfony/config" : "v5.3.4",
"symfony/http-foundation" : "v5.3.7",
"symfony/dependency-injection" : "v5.3.8",
Expand Down
139 changes: 138 additions & 1 deletion src/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/decider/agent_tests/Unit/DeciderAgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DeciderAgentTest extends \PHPUnit\Framework\TestCase
* @brief Setup test objects, database and repo
* @see PHPUnit_Framework_TestCase::setUp()
*/
protected function setUp()
protected function setUp() : void
{
global $container;
$container = M::mock('ContainerBuilder');
Expand Down Expand Up @@ -91,7 +91,7 @@ protected function setUp()
* @brief Remove test objects
* @see PHPUnit_Framework_TestCase::tearDown()
*/
protected function tearDown()
protected function tearDown() : void
{
$this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
M::close();
Expand Down
2 changes: 1 addition & 1 deletion src/delagent/ui/delete-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @param $user_pk - the user_id
* @param $group_pk - the group_id
* @param $uploadDao - an instance of a uploadDao
* @return string with the message.
* @return DeleteResponse with the message.
*/
function TryToDelete($uploadpk, $user_pk, $group_pk, $uploadDao)
{
Expand Down
4 changes: 2 additions & 2 deletions src/lib/c/tests/testClib.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ class TestCLib extends \PHPUnit\Framework\TestCase
/** @var TestPgDb */
private $testDb;

protected function setUp()
protected function setUp() : void
{
$this->testDb = new TestPgDb("testlibc".time());
}

protected function tearDown()
protected function tearDown() : void
{
$this->testDb = null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/php/Application/test/LicenseCsvExportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LicenseCsvExportTest extends \PHPUnit\Framework\TestCase
* @brief One time setup for test
* @see PHPUnit::Framework::TestCase::setUp()
*/
protected function setUp()
protected function setUp() : void
{
$this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
}
Expand All @@ -42,7 +42,7 @@ protected function setUp()
* @brief Close mockery
* @see PHPUnit::Framework::TestCase::tearDown()
*/
protected function tearDown()
protected function tearDown() : void
{
$this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
M::close();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/php/Application/test/LicenseCsvImportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LicenseCsvImportTest extends \PHPUnit\Framework\TestCase
* @brief One time setup for test
* @see PHPUnit::Framework::TestCase::setUp()
*/
protected function setUp()
protected function setUp() : void
{
$this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
}
Expand All @@ -45,7 +45,7 @@ protected function setUp()
* @brief Close mockery
* @see PHPUnit::Framework::TestCase::tearDown()
*/
protected function tearDown()
protected function tearDown() : void
{
$this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
M::close();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/php/Application/test/RepositoryApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class RepositoryApiTest extends \PHPUnit\Framework\TestCase
* Mock the CurlRequest class and set mockCurlRequest variable
* @see PHPUnit::Framework::TestCase::setUp()
*/
protected function setUp()
protected function setUp() : void
{
$this->mockCurlRequest = \Mockery::mock('CurlRequest');

Expand All @@ -58,7 +58,7 @@ protected function setUp()
* @brief Tear down mock objects
* @see PHPUnit::Framework::TestCase::tearDown()
*/
public function tearDown()
public function tearDown() : void
{
\Mockery::close();
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/php/Application/test/UserInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class UserInfoTest extends \PHPUnit\Framework\TestCase
* @brief One time setup for test
* @see PHPUnit::Framework::TestCase::setUp()
*/
protected function setUp()
protected function setUp() : void
{
$this->userInfo = new UserInfo();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AgentLicenseEventProcessorTest extends \PHPUnit\Framework\TestCase
private $latestScanners = array(array('agent_pk'=>23,'agent_name'=>'nomos'),
array('agent_pk'=>22,'agent_name'=>'monk'));

protected function setUp()
protected function setUp() : void
{
$this->licenseDao = M::mock(LicenseDao::class);
$this->agentsDao = M::mock(AgentDao::class);
Expand All @@ -60,7 +60,7 @@ protected function setUp()
$container->shouldReceive('get')->withArgs(array('db.manager'))->andReturn($this->dbManagerMock);
}

protected function tearDown()
protected function tearDown() : void
{
M::close();
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/php/BusinessRules/test/ClearingDecisionFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class ClearingDecisionFilterTest extends \PHPUnit\Framework\TestCase
/** @var ClearingDecisionFilter */
private $clearingDecisionFilter;

protected function setUp()
protected function setUp() : void
{
$this->clearingDecisionFilter = new ClearingDecisionFilter();
}

protected function tearDown()
protected function tearDown() : void
{
M::close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ClearingDecisionProcessorTest extends \PHPUnit\Framework\TestCase
/** @var boolean */
private $includeSubFolders;

protected function setUp()
protected function setUp() : void
{
$this->uploadTreeId = 432;
$this->pfileId = 32;
Expand All @@ -92,7 +92,7 @@ protected function setUp()
$this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
}

protected function tearDown()
protected function tearDown() : void
{
$this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
M::close();
Expand Down

0 comments on commit 9aafaf6

Please sign in to comment.