Skip to content

Instantly share code, notes, and snippets.

View reinhurd's full-sized avatar

Mikhail Bozhenov reinhurd

View GitHub Profile
@reinhurd
reinhurd / someFile
Created June 3, 2020 05:26
Mock Yii AR props
//code to correct set AR props
//https://forum.yiiframework.com/t/how-to-mock-activerecord/83931
$attributes = (new TaskExpendableReceipt)->attributes();
$relations = ['receipt_date'];
$receiptMock = $this->getMockBuilder(TaskExpendableReceipt::class)
->setMethods(['attributes'])
->getMock();
$receiptMock->method('attributes')
->willReturn(array_merge($attributes, $relations));
@reinhurd
reinhurd / index.php
Last active January 24, 2022 13:11
Апи ФНС РФ по выдаче информации о чеках - рабочая схема подключения на ПХП
<?php
//скрыть, если не пользуетесь прокси.
$proxy="127.0.0.1:1337";
$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);