Skip to content

Instantly share code, notes, and snippets.

View ismail1432's full-sized avatar
🏠
Looking for remote job

Smaine Milianni ismail1432

🏠
Looking for remote job
View GitHub Profile
<?php
interface DebuggerInterface
{
public function debug();
}
// Should be used only for French context
class DebuggerForFrenchContext implements DebuggerInterface
{
public function debug()
{
# services.yaml
App\Debug\DebuggerForFrenchContext:
tags:
- 'app.custom_debug_fr'
App\Debug\DebuggerCheeseForFrenchContext:
tags:
- 'app.custom_debug_fr'
<?php
// check_and_notify.php
function notifySlack(string $message): void
{
$curl = curl_init();
curl_setopt_array(
$curl,
[
CURLOPT_URL => getSlackUrl(),
<?php
// config.php
// config can be done with constant
const ENDPOINT_TO_CHECK = ['www.google.com', 'http://127.0.0.1:8000'];
const SLACK_CHANNEL = 'monitoring-web-app'; // channel where post the message
const SLACK_URL = 'https://slack.com/api/chat.postMessage';
const SLACK_TOKEN= 'token given by slack';
// config with function to fetch env var...
function getSlackUrl(): string
@ismail1432
ismail1432 / ext.txt
Created January 30, 2021 20:45 — forked from chronon/ext.txt
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
Feature: User Authentication Background:
Given the user is already registered to the website Scenario:
Given the user is on the login page
When the user inputs the correct email address
And the user inputs the correct password
And the user clicks the Login button
Then the user should be authenticated
And the user should be redirected to their dashboard
And the user should be presented with a success message
Scenario: I should be able to update a Bookmark
Given I add "Content-Type" header equal to "application/json"
And I send a "PUT" request to "/bookmarks/a179e430-6356-4fb5-91b2-ead2e166fa77" with body:
"""
{
"title": "bookmark_1 edited",
"author": "Adah edited",
"url": "www.such-url-1-edited.com",
"height": 25,
"width": 49,
<?php
class BookmarkTest extends TestCase
{
public function testPut()
{
$payload = [
'title' => 'bookmark_1 edited'
'author' => 'Adah edited',
'url' => 'www.such-url-1-edited.com',
'height' => 25,
Feature: Search Api
In order to store document in Elasticsearch
As a developer
I want to partially update document into Elasticsearch
# Publish the message
Given I publish in 'search_indexing' messenger queue the following message:
| App\SearchBundle\Message\SearchIndexationMessage | {"type":"Product","operation":"UPDATE", "id": 42, "title": "Foo", "reference": null} |
# Consume the message
And I consume 1 messages in search_indexing messenger queue
Scenario: Export a csv email
Given I publish in client_export messenger queue the following message:
| App\\Message\ExportMessage | {"emailTo":"[email protected]"} |
Then I consume 1 messages in user_export messenger queue
Then the user_export messenger queue should be empty
And 1 mail should be sent
And I open mail with subject "Your export file is ready"
And I should see "Your export file is ready, you can download it by clicking on this link : https://domain.docker.com/export_files/export_user" in mail
And the Excel file with glob "var/upload/async_export/*.xlsx" should contain:
| A1 | Fixture A ID |