Skip to content

Instantly share code, notes, and snippets.

View norberttech's full-sized avatar

Norbert Orzechowicz norberttech

View GitHub Profile
node('rundeck-cli') {
withCredentials([string(credentialsId: 'rundeck-token', variable: 'RD_TOKEN')]) {
stage('Get list of rundeck projects') {
try {
def projects = sh(returnStdout: true, script: 'rd projects list --outformat "%name"').toString().trim()
projects.split().each {
sh script: 'rd executions deletebulk -y -m ${RD_OPTION_BATCH:-20} --older ${RD_OPTION_OLDER_THAN:-7d} -p ' + it
}
<?php
$dto = new DTO {
foo = new FooDTO {
f1 = "test",
f2 = "test2"
}
bar = new BarDTO {
b1 = "test",
b2 = "test2"
vendor/bin/roave-no-leaks
PHPUnit 8.0.5 by Sebastian Bergmann and contributors.
............................................................... 63 / 154 ( 40%)
............................................................... 126 / 154 ( 81%)
............................ 154 / 154 (100%)................................... 189 / 154 (122%)
............................................................... 252 / 154 (163%)
............................................................... 315 / 154 (204%)
.......PHP Fatal error: Uncaught Exception: The following test produced memory leaks:
* App\Tests\Functional\Console\Email\ScanMessagesTest::test_marking_messages_for_existing_offer_as_seen_and_forwarding_email
Feature: Api Facebook Login
In order to allow users to login with facebook
As API client
I need to trade user facebook token for user api token
Background:
Given I set request header "Content-Type" to "application/json"
Scenario: Obtain api token using "http://facebook.com" grant type
Given API client with following parameters exists
@norberttech
norberttech / SomethingTest.php
Created April 12, 2016 07:41
Simple Test Case
<?php
class SomethingTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
it_should_do_something()
{
$this->thereIsSomethingGiven(); // Arrange
@norberttech
norberttech / position.js
Created February 20, 2016 20:22
There is a bug in line 13 that could be avoided with mutation testing...
export default Position
{
/// code
/**
* @param {Position} position
* @return {boolean}
*/
isEqual(position)
{
<?php
$loader = require_once __DIR__ . '/../vendor/autoload.php';
$registrationService = $this->get('custom.registration.service');
$registrationClosure = $this->get('custom.registration.closure');
$registrationService->register(['username' => 'norzechowicz'], $registrationClosure);
<?php
namespace Application\Constraint;
trait NotEmptyStringConstraint
{
protected function validate($data, $exceptionClass = "Application\\Constraint\\InvalidArgumentException", $message = null)
{
$className = "\\" . ltrim($exceptionClass, "\\");
<?php
class ProductController
{
public function createProductAction(Request $request)
{
$command = new CreateProductCommand();
$form = $this->createForm(new ProductType(), $command);
$form->handle($request);
<?php
class BlogController extends Controller
{
/**
* @Route("/comment/{postSlug}/new", name = "comment_new")
* @Security("is_granted('IS_AUTHENTICATED_FULLY')")
*
* @Method("POST")
* @ParamConverter("post", options={"mapping": {"postSlug": "slug"}})