Welcome Guest, Not a member yet? Register   Sign In
Is it possible to run CI3 unit tests without sudo privileges?
#3

(03-07-2023, 06:06 PM)kenjis Wrote: See https://github.com/kenjis/ci-phpunit-test

Thank you, @kenjis, for this suggestion. I'm finally getting around to trying it.

I note that the steps you outline in your README results in a LOT of files being added to one's application folder. The ci-phpunit-test-3.0.4/application/tests folder has 1025 files in it, including 4 shell scripts, 669 PHP files, and hundreds of other files. I also note that running install.php doesn't appear to change any files, at least none that git can detect.

Also, I ran into an error installing phpunit via composer:
Code:
$ ./composer.phar require phpunit/phpunit --dev
./composer.json has been updated
Running composer update phpunit/phpunit
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
25 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php
sed: 1: "vendor/mikey179/vfsstre ...": invalid command code v
Script sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php handling the post-update-cmd event returned with error code 1

Finally, the tests would not run.
Code:
$ vendor/bin/phpunit -c application/tests/
PHPUnit 9.6.5 by Sebastian Bergmann and contributors.

Error in bootstrap script: ArgumentCountError:
Too few arguments to function CI_Hooks::__construct(), 0 passed in /private/tmp/foo/CodeIgniter-develop/application/tests/_ci_phpunit_test/replacing/core/Common.php on line 111 and exactly 1 expected
#0 /private/tmp/foo/CodeIgniter-develop/application/tests/_ci_phpunit_test/replacing/core/Common.php(111): CI_Hooks->__construct()
#1 /private/tmp/foo/CodeIgniter-develop/application/tests/_ci_phpunit_test/replacing/core/CodeIgniter.php(202): load_class('Hooks', 'core')
#2 /private/tmp/foo/CodeIgniter-develop/application/tests/_ci_phpunit_test/CIPHPUnitTest.php(118): require('/private/tmp/fo...')
#3 /private/tmp/foo/CodeIgniter-develop/application/tests/_ci_phpunit_test/CIPHPUnitTest.php(70): CIPHPUnitTest::loadCodeIgniter()
#4 /private/tmp/foo/CodeIgniter-develop/application/tests/Bootstrap.php(389): CIPHPUnitTest::init()
#5 /private/tmp/foo/CodeIgniter-develop/vendor/phpunit/phpunit/src/Util/FileLoader.php(66): include_once('/private/tmp/fo...')
#6 /private/tmp/foo/CodeIgniter-develop/vendor/phpunit/phpunit/src/Util/FileLoader.php(49): PHPUnit\Util\FileLoader::load('/private/tmp/fo...')
#7 /private/tmp/foo/CodeIgniter-develop/vendor/phpunit/phpunit/src/TextUI/Command.php(565): PHPUnit\Util\FileLoader::checkAndLoad('/private/tmp/fo...')
#8 /private/tmp/foo/CodeIgniter-develop/vendor/phpunit/phpunit/src/TextUI/Command.php(345): PHPUnit\TextUI\Command->handleBootstrap('/private/tmp/fo...')
#9 /private/tmp/foo/CodeIgniter-develop/vendor/phpunit/phpunit/src/TextUI/Command.php(112): PHPUnit\TextUI\Command->handleArguments(Array)
#10 /private/tmp/foo/CodeIgniter-develop/vendor/phpunit/phpunit/src/TextUI/Command.php(97): PHPUnit\TextUI\Command->run(Array, true)
#11 /private/tmp/foo/CodeIgniter-develop/vendor/phpunit/phpunit/phpunit(98): PHPUnit\TextUI\Command::main()
#12 /private/tmp/foo/CodeIgniter-develop/vendor/bin/phpunit(123): include('/private/tmp/fo...')
#13 {main}
Reply


Messages In This Thread
RE: Is it possible to run CI3 unit tests without sudo privileges? - by sneakyimp - 03-21-2023, 02:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB