Skip to content

sjavadez/camel-case-php-puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Puzzle

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.

Requirements

  • PHP 8.3 or higher
  • Composer
  • OpenSSL (for encryption/decryption of the test file)
  • PHPUnit (for running tests)

Installation

  1. Clone the repository to your local machine.
    git clone https://github.com/your-username/quiz-project.git
  2. Navigate to the project directory.
    cd camel-case-php-puzzle
  3. Install the required dependencies using Composer.
    composer install

Usage

Implementing the toCamelCase Function

  1. Open the src/quiz.php file.
  2. Implement the toCamelCase function according to the requirements.
  3. Save your changes.

Running the Tests

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.

  1. Ensure that openssl and phpunit are properly installed and accessible from the command line.
  2. Run the submit.sh script to test your implementation:
    ./runexam.sh.x
  3. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages