This puzzle is a coding challenge where students implement the toCamelCase
function in PHP. The function should convert different string cases like PascalCase, snake_case, kebab-case, or strings with spaces into camelCase. The student's implementation will be automatically tested, and upon passing all tests, they will receive a reward code.
- PHP 8.3 or higher
- Composer
- OpenSSL (for encryption/decryption of the test file)
- PHPUnit (for running tests)
- Clone the repository to your local machine.
git clone https://github.com/your-username/quiz-project.git
- Navigate to the project directory.
cd camel-case-php-puzzle
- Install the required dependencies using Composer.
composer install
- Open the
src/quiz.php
file. - Implement the
toCamelCase
function according to the requirements. - Save your changes.
You will run a provided shell script that will automatically decrypt the test file, run the tests, and check if your implementation passes all tests.
- Ensure that
openssl
andphpunit
are properly installed and accessible from the command line. - Run the
submit.sh
script to test your implementation:./runexam.sh.x
- The script will perform the following actions:
- Decrypt the encrypted test file (
CamelCaseTest.php.enc
). - Run the tests using PHPUnit.
- If all tests pass, a reward code will be displayed.
- If the tests fail, you will be prompted to check the log file for details.
- Decrypt the encrypted test file (