Esempio n. 1
0
 /**
  * @expectedException \Angrybender\Pattern\Matching\NoMatch
  */
 public function testPatternsException()
 {
     $data = [['id' => 1], ['id' => 2], ['id' => null], ['id' => 3], ['id' => 4]];
     $matcher = Fabric::createMatching();
     $pull = new MatchingTest2();
     $result = $matcher->setObject($pull)->execute($data);
 }
Esempio n. 2
0
 public function testIntegration4()
 {
     $assign = Fabric::createAssign();
     list($id, $user, list($namee, $contacts)) = $assign->get(['id' => 1, 'user' => ['name' => 'Foo Bar', 'contacts' => 'foo bar baz']]);
     $this->assertEquals(null, $id);
     $this->assertEquals(null, $namee);
     $this->assertEquals(null, $contacts);
 }
Esempio n. 3
0
<?php

/**
 * Created by PhpStorm.
 * User: Kir
 * Date: 14.10.2015
 * Time: 20:14
 */
include __DIR__ . '/../../../../autoload.php';
$assign = \Angrybender\Pattern\Fabric::createAssign();
$yaDisk = ["trash_size" => 4631577437.0, "total_space" => 319975063552.0, "used_space" => 26157681270.0, "system_folders" => ["applications" => "disk:/apps", "downloads" => "disk:/download/"]];
list($system_folders, list($applications, $downloads)) = $assign->get($yaDisk);
var_dump($applications);
var_dump($downloads);