This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$logger = new Logger('appLogger'); | |
$logger->pushHandler(new StreamHandler("monolog_php_errors.log")); | |
$logger->error('This is my error log message from monolog logger'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('log_errors', TRUE); | |
ini_set('error_log', 'php_errors.log'); | |
ini_set('error_reporting', E_ALL); | |
$notArray = 'string'; | |
array_pop($notArray); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\tests\urban_module\FunctionalJavascript; | |
use Drupal\FunctionalJavascriptTests\WebDriverTestBase; | |
/** | |
* Tests urban definition list block (including JS functionality). | |
*/ | |
class UrbanDefinitionListBlockJavascriptTest extends WebDriverTestBase { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
mariadb: | |
container_name: "drupal_testing_mariadb" | |
image: wodby/mariadb | |
container_name: "mariadb" | |
environment: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: drupal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\tests\urban_module\Functional; | |
use Drupal\Tests\BrowserTestBase; | |
/** | |
* Tests urban definition list block. | |
*/ | |
class UrbanDefinitionListBlockTest extends BrowserTestBase { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\urban_module\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; | |
use Drupal\Core\Entity\EntityStorageInterface; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Drupal\Core\Url; | |
use Symfony\Component\DependencyInjection\ContainerInterface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\tests\urban_module\Kernel; | |
use Drupal\Core\DependencyInjection\ContainerBuilder; | |
use Drupal\field\Entity\FieldConfig; | |
use Drupal\field\Entity\FieldStorageConfig; | |
use Drupal\KernelTests\KernelTestBase; | |
use Drupal\node\Entity\Node; | |
use Drupal\node\Entity\NodeType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function urban_module_node_presave(NodeInterface $node) { | |
if ($node->bundle() == 'urban_definition') { | |
/** @var \Drupal\urban_module\Service\UrbanDictionaryService $ubService */ | |
$ubService = \Drupal::service('urban_module.service'); | |
$definition = $ubService->getDefinition($node->getTitle()); | |
if (!empty($definition)) { | |
$node->title->value = $definition->getTerm(); | |
$node->field_definition->value = $definition->getDefinition(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<testsuites> | |
<testsuite name="unit"> | |
<file>./tests/TestSuites/UnitTestSuite.php</file> | |
</testsuite> | |
<testsuite name="kernel"> | |
<file>./tests/TestSuites/KernelTestSuite.php</file> | |
</testsuite> | |
<testsuite name="functional"> | |
<file>./tests/TestSuites/FunctionalTestSuite.php</file> | |
</testsuite> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\tests\urban_module\Unit; | |
use Drupal\Core\Logger\LoggerChannelFactoryInterface; | |
use Drupal\Tests\UnitTestCase; | |
use Drupal\urban_module\Service\UrbanDictionaryService; | |
use GuzzleHttp\ClientInterface; | |
use GuzzleHttp\Exception\RequestException; | |
use Psr\Http\Message\RequestInterface; |
NewerOlder