Sascha Grossenbacher
https://slides.com/saschagrossenbacher/drupal9
drupalmountaincamp.ch
Symfony 3 EOL
Cost of deprecated code
300 Legacy Tests
https://dri.es/drupal-7-8-and-9
* Yes, old image
*
https://dri.es/plan-for-drupal-9
* Yes, old image
*
https://dri.es/drupal-7-8-and-9
/**
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.
* Use EntityTypeManagerInterface::getDefinition() instead.
* See https://www.drupal.org/node/2549139.
*/
public function getDefinition() {
For automated test and (maybe, later) also per-site logging.
@trigger_error("format_date() is deprecated in Drupal 8.0.0 and will
be removed before Drupal 9.0.0. Use \Drupal::service('date.formatter')->format()
instead. See https://www.drupal.org/node/1876852",
E_USER_DEPRECATED);
OK (2 tests, 108 assertions)
Remaining deprecation notices (1)
1x: The property entityManager (entity.manager service) is deprecated in
Drupal\views\Plugin\views\row\EntityRow and will be removed before Drupal 9.0.0.
1x in AggregatorRenderingTest::testFeedPage from Drupal\Tests\aggregator\Functional
Option 1: Look at the deprecated function
function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) {
return \Drupal::service('date.formatter')->format($timestamp, $type, $format, $timezone, $langcode);
}
Pre-Split (8.0.0-rc2)
1500 Lines of Code
50 public methods
1700 LoC Unit Test
Basically the single API of the (large) entity system
Post-Split
EntityTypeManager
EntityFieldManager
EntityTypeRepository
EntityRepository
EntityDisplayRepository
EntityTypeBundleInfo
Several Listeners
db_*()
format_date()
file_*()
entity_*()
....
\Drupal::database()->...()
$date_formatter->format()
$file_system->...()
$entity_storage->...()
$EntityClass::...()
...
$entity->url()
$entity->link()
$file->url()
file_transform_relative($file->url())
....
$entity->toUrl()->toString()
$entity->toLink()->toString()
$file->createFileUrl(FALSE)
$file->createFileUrl()
Custom Fork of Simpletest
project
Added 11 years ago to Drupal
KernelTestBase
WebTestBase
src/Tests
Well-Known PHP components: PHPUnit, Mink, Selenium
KernelTestBase
UnitTestCase
BrowserTestBase
WebDriverTestBase
Nightwatch
tests/src/$TestType